- 论坛徽章:
- 0
|
我的机器环境配置如下:
实际的操作系统:
windows server 2003
vmware 5.53
所有的测试都在vmware机的两个操作系统里进行。(dhcp服务器:redhat as 4 客户机:suse10.1)
主机的配置如下:
eth0:
ip: 192.168.1.16
umask: 255.255.255.0
gateway:192.168.1.12
外置一个神州数码的猫:(通过拔号的方式上网,猫的IP是固定的)
ip: 192.168.1.1
umask: 255.255.255.0
----------------------------------------------------------------------------------------------
我的目的是想让linux来拔号,让windows上网。
因为我安装了二个linux操作系统所以打算所有的测试都用在虚拟机中完成。其中vmware机操作系统与主机(windows server 2003)都是用的网桥。(说明一下,其实我的猫可以设置成路由的。三种方式都能实现上网通信,这里只是学习测试。),因为是网桥的所以只用一块vmware Adapter,ip address随机设置一个都可以.下面是服务器与客户机的设置。
vmware机的主机 dhcp服务器)
dhcp服务器:
Linux version 2.6.9-5.EL (bhcompile@decompose.build.redhat.com) (gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)) #1 Wed Jan 5 19:22:18 EST 2005
eth0配置如下:
ip: 192.168.1.12
umast: 255.255.255.0
gateway:192.168.1.12
ppp0(我已经改成了别名crc,即adsl拔号用的)
查看一下服务器的路由:
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.11.2 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.11.2 0.0.0.0 UG 0 0 0 ppp0
ping www.sohu.com
PING cachepool2.a.sohu.com (220.181.26.149) 56(84) bytes of data.
64 bytes from arpa-jxq-ct-bj.sohu.com (220.181.26.149): icmp_seq=0 ttl=51 time=133 ms
64 bytes from arpa-jxq-ct-bj.sohu.com (220.181.26.149): icmp_seq=1 ttl=51 time=96.1 ms
64 bytes from arpa-jxq-ct-bj.sohu.com (220.181.26.149): icmp_seq=2 ttl=51 time=147 ms
64 bytes from arpa-jxq-ct-bj.sohu.com (220.181.26.149): icmp_seq=3 ttl=51 time=140 ms
64 bytes from arpa-jxq-ct-bj.sohu.com (220.181.26.149): icmp_seq=4 ttl=51 time=149 ms
--- cachepool2.a.sohu.com ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 18256ms
rtt min/avg/max/mdev = 63.613/122.771/149.793/23.937 ms, pipe 2
一切都正常! 以下是服务的配置信息:
host.conf文件内容:
order hosts,bind
network文件内容:
NETWORKING=yes
HOSTNAME=redhat
DOMAINNAME='ty-linux.com'
# GATEWAY=192.168.1.12
GATEWAYDEV=crc
hosts文件:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.12 redhat.ty-linux.com redhat redhat
resolv.conf文件内容:
nameserver 61.144.56.100
nameserver 219.150.32.132
dhcpd.conf文件内容:
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.12;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.12;
option domain-name "redhat.ty-linux.com"; # 设置过公网DNS,客户机也上不外网
range dynamic-bootp 192.168.1.30 192.168.1.50;
default-lease-time 21600;
max-lease-time 43200;
host redhat {
hardware ethernet 00:0C:29:F6:B5:C7;
fixed-address 192.168.1.12;
}
}
vmware 客户机(suse linux 10.1)
ip:自动从redhat虚拟主机上得到动态IP
hosts文件内容:
127.0.0.1 localhost
192.168.1.12 redhat.ty-linux.com
# special IPv6 address
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.2 suse.ty-linux.com suse
host.conf文件内容:
order hosts,bind
multi on
resolv.conf文件内容:
domain ty-linux.com
nameserver 61.144.56.100
nameserver 219.150.32.132
查看一下服务器的路由:
netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
link-local * 255.255.0.0 U 0 0 0 eth1
loopback * 255.0.0.0 U 0 0 0 lo
default redhat.ty-linux 0.0.0.0 UG 0 0 0 eth1
#ping www.sohu.com
ping: unknow host www.sohu.com
无语!!!快二天了,还没有解决!
我是没有设置DNS服务器。若不设置domain server 客户机应该指定192.168.1.12为dns也还是不行,全部设置外网的dns也没有用。
suse客户机ping redhat或ping redhat.ty-linux.com都能ping通。但redhat主机却不能ping 通客户机suse.
望高手相助! |
|