/etc/network/interfacesに
auto eth1
iface eth1 inet static
とか書きますけど、なんでeth1断定できるのかわけわかんない。
どんな環境でも絶対eth0とか1なのかよ。。。
そんなことはありません。てなわけで、ネットワークアダプタの探し方を紹介します。
ls /sys/class/net
すると、アダプタ一覧が表示されました。
[email protected]:~# ls /sys/class/net enp0s3 enp0s8 enp0s9 lo [email protected]:~# vi /etc/network/interfaces ^[[[email protected]:~# ifup enp0s3 Internet Systems Consortium DHCP Client 4.3.3 Copyright 2004-2015 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/enp0s3/0ああああ Sending on LPF/enp0s3/0ああああ Sending on Socket/fallback DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0xebc6721b) DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 6 (xid=0xebc6721b) DHCPREQUEST of ああ on enp0s3 to 255.255.255.255 port 67 (xid=0x1b72c6eb) DHCPOFFER of ああ from あああ DHCPACK of ああ from あああ bound to ああ -- renewal in 40279 seconds. [email protected]:~# [email protected]:~# ping haniokasai.com PING haniokasai.com (104.27.142.118) 56(84) bytes of data. 64 bytes from 104.27.142.118: icmp_seq=1 ttl=54 time=57.0 ms 64 bytes from 104.27.142.118: icmp_seq=2 ttl=54 time=55.6 ms ^C --- haniokasai.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 55.672/56.344/57.017/0.713 ms [email protected]:~#
ようやくネットが使えるようになりました。。。
うまく動かなくなったvirtualboxで。。。
参考文献
https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in
0 件のコメント:
コメントを投稿