这个问题谁会?
superasp
|
1#
superasp 发表于 2002-02-21 11:33
这个问题谁会?
本人服务器上两张网卡,eth0:192.168.0.1 接内网,eth1:192.168.0.5接adsl.
一:启动network [root@Superasp root]# service network start Setting network parameters: [ OK ] Bringing up interface lo: [ OK ] Bringing up interface eth0: [ OK ] Bringing up interface eth1: [ OK ] route: netmask doesn't match route address Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables route [-v] [-FC] {add|del|flush} ... Modify routing table for AF. route {-h|--help} [<AF>] Detailed usage syntax for specified AF. route {-V|--version} Display version/author and exit. -v, --verbose be verbose -n, --numeric don't resolve names -e, --extend display other/more information -F, --fib display Forwarding Information Base (default) -C, --cache display routing cache instead of FIB <AF>=Use '-A <af>' or '--<af>'; default: inet List of possible address families (which support routing): inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) x25 (CCITT X.25) 提示有错误!!!!!!!! 使用ifconfig命令提示如下: [root@Superasp root]# ifconfig eth0 Link encap:Ethernet HWaddr 52:54:AB:25:3F:89 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:40 errors:0 dropped:0 overruns:0 frame:0 TX packets:98 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:5203 (5.0 Kb) TX bytes:13702 (13.3 Kb) Interrupt:11 Base address:0xd800 eth1 Link encap:Ethernet HWaddr 52:54:AB:39:CD:2A inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:14 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 b) TX bytes:840 (840.0 b) Interrupt:5 Base address:0xe000 lo Link encapocal Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:225 errors:0 dropped:0 overruns:0 frame:0 TX packets:225 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:17309 (16.9 Kb) TX bytes:17309 (16.9 Kb) 使用route命令提示如下: [root@Superasp root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo 这个时候ping 另外一台计算机:192.168.0.2 是ping不通的,因为没有缺省网关.另外上面的路由表上有两个一样的eth1的网段,不知道是怎么搞的? 看了心烦,干掉它: [root@Superasp root]# ifconfig eth1 down 启动adsl: [root@Superasp root]# adsl-start . Connected! 查看网络状态: [root@Superasp root]# ifconfig eth0 Link encap:Ethernet HWaddr 52:54:AB:25:3F:89 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:16 errors:0 dropped:0 overruns:0 frame:0 TX packets:103 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1242 (1.2 Kb) TX bytes:14774 (14.4 Kb) Interrupt:11 Base address:0xd800 eth1 Link encap:Ethernet HWaddr 52:54:AB:39:CD:2A inet addr:192.168.0.5 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:9 errors:0 dropped:0 overruns:0 frame:0 TX packets:34 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:540 (540.0 b) TX bytes:2040 (1.9 Kb) Interrupt:5 Base address:0xe000 lo Link encapocal Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:213 errors:0 dropped:0 overruns:0 frame:0 TX packets:213 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:16531 (16.1 Kb) TX bytes:16531 (16.1 Kb) ppp0 Link encapoint-to-Point Protocol inet addr:61.171.128.182 P-t-P:218.1.1.252 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1 RX packets:3 errors:0 dropped:0 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:30 (30.0 b) TX bytes:30 (30.0 b) 连上了网,不果eth1又活了!查看路由表: [root@Superasp root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 218.1.1.252 * 255.255.255.255 UH 0 0 0 ppp0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 218.1.1.252 0.0.0.0 UG 0 0 0 ppp0 你瞧,192.168.0.0 这个网段的连接应该是eth0结果变成了eth1,而eth1是和外部用adsl连接的.修改路由表成: [root@Superasp root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 218.1.1.252 * 255.255.255.255 UH 0 0 0 ppp0 192.168.0.0 * 255.255.255.0 U 0 0 0 eth0 127.0.0.0 * 255.0.0.0 U 0 0 0 lo default 218.1.1.252 0.0.0.0 UG 0 0 0 ppp0 这样后,一切正常,但我不知道该在什么地方改能一劳永逸. |