實驗室使用板子的ubuntu10.04虛擬機器的網路設定 實驗室和寢室的網路有不同。 昨天來到實驗室,要想使用nfs,用虛擬機器裡的ubuntu10.04訪問外網,必須要設定網路。 桂工的網路很有特點。每個機子的ip地址幾乎就是固定分破的。而且有很多子網存在。 ubuntu上用drcom的用戶端可以訪問。vmware可以設定與主機共用上網。 ======================================================================= 設定都是在etc目錄下的。 昨天修改了hostname。 今天修改網路設定。主要涉及到 /etc/network下的interfaces和/etc/resolv.conf ======================================================================= 學校實驗室的網路資訊: 按照這個資訊,把虛擬機器裡的ubuntu10.04設定為 1 # The primary network interface 2 auto eth0 3 iface eth0 inet static 不是很懂是什麼意思。 4 address 202.193.89.253 自己設定的,不是網關分配的。 5 netmask 255.255.255.192 這個子網路遮罩,最後是192 6 gateway 202.193.89.254 7 #iface eth0 inet dhcp 8 auto lo 9 iface lo inet loopback 10 ~ 把resolv.conf修改下: ====================================== ping下,成功了: root@ubuntu:/etc# cd network root@ubuntu:/etc/network# lsif-down.d if-post-down.d if-pre-up.d if-up.d interfaces interfaces-502root@ubuntu:/etc/network# vi interfacesroot@ubuntu:/etc/network# ping 127.0.0.1PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.027 ms^[[A64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.026 ms^C--- 127.0.0.1 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 999msrtt min/avg/max/mdev = 0.026/0.026/0.027/0.005 msroot@ubuntu:/etc/network# ping 202.193.80.203PING 202.193.80.203 (202.193.80.203) 56(84) bytes of data.^C--- 202.193.80.203 ping statistics ---3 packets transmitted, 0 received, 100% packet loss, time 1999ms root@ubuntu:/etc/network# ping 202.193.89.203 PING 202.193.89.203 (202.193.89.203) 56(84) bytes of data.64 bytes from 202.193.89.203: icmp_seq=1 ttl=64 time=4.82 ms64 bytes from 202.193.89.203: icmp_seq=27 ttl=64 time=0.082 ms64 bytes from 202.193.89.203: icmp_seq=28 ttl=64 time=0.193 ms64 bytes from 202.193.89.203: icmp_seq=29 ttl=64 time=0.191 ms64 bytes from 202.193.89.203: icmp_seq=30 ttl=64 time=0.114 ms64 bytes from 202.193.89.203: icmp_seq=31 ttl=64 time=0.110 ms64 bytes from 202.193.89.203: icmp_seq=32 ttl=64 time=0.116 ms64 bytes from 202.193.89.203: icmp_seq=33 ttl=64 time=0.116 ms64 bytes from 202.193.89.203: icmp_seq=34 ttl=64 time=0.121 ms64 bytes from 202.193.89.203: icmp_seq=35 ttl=64 time=0.156 ms64 bytes from 202.193.89.203: icmp_seq=36 ttl=64 time=0.118 ms64 bytes from 202.193.89.203: icmp_seq=37 ttl=64 time=0.155 ms64 bytes from 202.193.89.203: icmp_seq=38 ttl=64 time=0.194 ms64 bytes from 202.193.89.203: icmp_seq=39 ttl=64 time=0.198 ms64 bytes from 202.193.89.203: icmp_seq=40 ttl=64 time=0.093 ms^C--- 202.193.89.203 ping statistics ---40 packets transmitted, 15 received, 62% packet loss, time 39002msrtt min/avg/max/mdev = 0.082/0.452/4.823/1.168 msroot@ubuntu:/etc/network# ping 202.193.89.254PING 202.193.89.254 (202.193.89.254) 56(84) bytes of data.64 bytes from 202.193.89.254: icmp_seq=6 ttl=64 time=1.52 ms64 bytes from 202.193.89.254: icmp_seq=7 ttl=64 time=2.93 ms64 bytes from 202.193.89.254: icmp_seq=8 ttl=64 time=2.10 ms^C--- 202.193.89.254 ping statistics ---8 packets transmitted, 3 received, 62% packet loss, time 7003msrtt min/avg/max/mdev = 1.521/2.187/2.933/0.579 msroot@ubuntu:/etc/network#