您的位置:首页 > 理论基础 > 计算机网络

实验室使用板子的ubuntu10.04虚拟机的网络配置

2011-07-05 10:15 701 查看
实验室和寝室的网络有不同。
昨天来到实验室,要想使用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#
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: