歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

實驗室使用板子的ubuntu10.04虛擬機的網絡配置

實驗室使用板子的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# ls if-down.d  if-post-down.d  if-pre-up.d  if-up.d  interfaces  interfaces-502 root@ubuntu:/etc/network# vi interfaces root@ubuntu:/etc/network# ping 127.0.0.1 PING 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 999ms rtt min/avg/max/mdev = 0.026/0.026/0.027/0.005 ms root@ubuntu:/etc/network# ping 202.193.80.203 PING 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 ms 64 bytes from 202.193.89.203: icmp_seq=27 ttl=64 time=0.082 ms 64 bytes from 202.193.89.203: icmp_seq=28 ttl=64 time=0.193 ms 64 bytes from 202.193.89.203: icmp_seq=29 ttl=64 time=0.191 ms 64 bytes from 202.193.89.203: icmp_seq=30 ttl=64 time=0.114 ms 64 bytes from 202.193.89.203: icmp_seq=31 ttl=64 time=0.110 ms 64 bytes from 202.193.89.203: icmp_seq=32 ttl=64 time=0.116 ms 64 bytes from 202.193.89.203: icmp_seq=33 ttl=64 time=0.116 ms 64 bytes from 202.193.89.203: icmp_seq=34 ttl=64 time=0.121 ms 64 bytes from 202.193.89.203: icmp_seq=35 ttl=64 time=0.156 ms 64 bytes from 202.193.89.203: icmp_seq=36 ttl=64 time=0.118 ms 64 bytes from 202.193.89.203: icmp_seq=37 ttl=64 time=0.155 ms 64 bytes from 202.193.89.203: icmp_seq=38 ttl=64 time=0.194 ms 64 bytes from 202.193.89.203: icmp_seq=39 ttl=64 time=0.198 ms 64 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 39002ms rtt min/avg/max/mdev = 0.082/0.452/4.823/1.168 ms root@ubuntu:/etc/network# ping 202.193.89.254 PING 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 ms 64 bytes from 202.193.89.254: icmp_seq=7 ttl=64 time=2.93 ms 64 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 7003ms rtt min/avg/max/mdev = 1.521/2.187/2.933/0.579 ms root@ubuntu:/etc/network#                            
Copyright © Linux教程網 All Rights Reserved