免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 4707 | 回复: 10
打印 上一主题 下一主题

小问题,讨论讨论(路由表) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-30 20:32 |只看该作者 |倒序浏览
[root@Runtop ~]# route\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# route add -net 10.0.0.0 netmask 255.255.255.0 dev eth1           \r\n[root@Runtop ~]# route\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n10.0.0.0        *               255.255.255.0   U     0      0        0 eth1\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# route\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# \r\n\r\n怎么加不进10.0.0.0/24网络?两张网卡(eth0 连外网 ,eth1连内网,PING不通10.0.0.0里的机子)\r\n\r\n[root@Runtop ~]# ifconfig\r\neth0      Link encap:Ethernet  HWaddr 00:14:BF:5D:6E:15  \r\n          inet addr:192.168.1.89  Bcast:192.168.1.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::214:bfff:fe5d:6e15/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:3274 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:2062 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:256281 (250.2 KiB)  TX bytes:243975 (238.2 KiB)\r\n          Interrupt:10 Base address:0x6000 \r\n\r\neth1      Link encap:Ethernet  HWaddr 00:18:F8:08:BA:57  \r\n          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::218:f8ff:fe08:ba57/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:337 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:87 errors:9 dropped:0 overruns:0 carrier:18\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:57783 (56.4 KiB)  TX bytes:13070 (12.7 KiB)\r\n          Interrupt:11 Base address:0xa000 \r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0\r\n          inet6 addr: ::1/128 Scope:Host\r\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1\r\n          RX packets:1852 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:1852 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:2786710 (2.6 MiB)  TX bytes:2786710 (2.6 MiB)\r\n\r\n[root@Runtop ~]# \r\n\r\n[root@Runtop ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0\r\n# Linksys NC100 Network Everywhere Fast Ethernet 10/100\r\nDEVICE=eth0\r\nONBOOT=yes\r\nBOOTPROTO=static\r\nHWADDR=00:14:BF:5D:6E:15\r\nIPADDR=192.168.1.89\r\nNETMASK=255.255.255.0\r\nNETWORK=192.168.1.0\r\nBOARDCAST=192.168.1.255\r\nGATEWAY=192.168.1.1\r\n\r\n[root@Runtop ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1\r\n# Linksys NC100 Network Everywhere Fast Ethernet 10/100\r\nDEVICE=eth1\r\nONBOOT=yes\r\nBOOTPROTO=static\r\nHWADDR=00:18:F8:08:BA:57\r\nIPADDR=10.0.0.1\r\nNETMASK=255.255.255.0\r\nBROADCAST=10.0.0.255\r\n\r\n[root@Runtop ~]#

论坛徽章:
0
2 [报告]
发表于 2008-06-30 20:58 |只看该作者
没道理\r\n10.0.0.0/24是eth1的直连网络,不用加路由,只要网卡up,running,就自己会生成路由加入路由表中\r\n\r\nLZ给的ifconfig信息很正常。eth1处于up running状态,为什么直连10段的路由不见了。。我分析不出原因\r\n\r\ntail -f /var/log/messages &\r\nservice network restart\r\n\r\n然后看看输出信息是有什么可参考的信息,帖出来看看

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
3 [报告]
发表于 2008-07-01 16:35 |只看该作者
1、这个路由条目无需添加的。\r\n\r\n\r\n按照LS的提示重新起一下网络看看。

论坛徽章:
0
4 [报告]
发表于 2008-07-01 20:27 |只看该作者
[root@Runtop ~]# tail -f /var/log/messages\r\nJul  1 20:38:27 Runtop sysctl: kernel.sysrq = 0\r\nJul  1 20:38:27 Runtop sysctl: kernel.core_uses_pid = 1\r\nJul  1 20:38:27 Runtop network: Setting network parameters:  succeeded\r\nJul  1 20:38:27 Runtop kernel: Disabled Privacy Extensions on device c0366c20(lo)\r\nJul  1 20:38:27 Runtop network: Bringing up loopback interface:  succeeded\r\nJul  1 20:38:29 Runtop network: Bringing up interface eth0:  succeeded\r\nJul  1 20:38:30 Runtop kernel: eth1: Setting full-duplex based on MII#1 link partner capability of 45e1.\r\nJul  1 20:38:30 Runtop kernel: eth0: Setting full-duplex based on MII#1 link partner capability of 4de1.\r\nJul  1 20:38:31 Runtop ifup: RTNETLINK answers: File exists\r\nJul  1 20:38:31 Runtop network: Bringing up interface eth1:  succeeded\r\nJul  1 20:40:01 Runtop crond(pam_unix)[5612]: session opened for user root by (uid=0)\r\nJul  1 20:40:01 Runtop crond(pam_unix)[5614]: session opened for user root by (uid=0)\r\nJul  1 20:40:01 Runtop crond(pam_unix)[5614]: session closed for user root\r\nJul  1 20:40:01 Runtop crond(pam_unix)[5612]: session closed for user root

论坛徽章:
0
5 [报告]
发表于 2008-07-01 20:32 |只看该作者
[root@Runtop ~]# route   \r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# service network restart\r\nShutting down interface eth0:                              [  OK  ]\r\nShutting down interface eth1:                              [  OK  ]\r\nShutting down loopback interface:                          [  OK  ]\r\nSetting network parameters:                                [  OK  ]\r\nBringing up loopback interface:                            [  OK  ]\r\nBringing up interface eth0:                                [  OK  ]\r\nBringing up interface eth1:                                [  OK  ]\r\n[root@Runtop ~]# route\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# \r\n\r\n\r\n装了DHCP服务器(分10.0.0.0网段IP,客户可以得到IP,但相互PING不通)\r\n[root@Runtop ~]# dhcpd\r\nInternet Systems Consortium DHCP Server V3.0.3\r\nCopyright 2004-2005 Internet Systems Consortium.\r\nAll rights reserved.\r\nFor info, please visit http://www.isc.org/sw/dhcp/\r\nWrote 0 deleted host decls to leases file.\r\nWrote 0 new dynamic host decls to leases file.\r\nWrote 2 leases to leases file.\r\nListening on LPF/eth1/00:18:f8:08:ba:57/10.0.0/24\r\nSending on   LPF/eth1/00:18:f8:08:ba:57/10.0.0/24\r\nListening on LPF/eth0/00:14:bf:5d:6e:15/192.168.1/24\r\nSending on   LPF/eth0/00:14:bf:5d:6e:15/192.168.1/24\r\nSending on   Socket/fallback/fallback-net\r\n[root@Runtop ~]#

论坛徽章:
0
6 [报告]
发表于 2008-07-01 20:58 |只看该作者

回复 #6 tiansky 的帖子

Jul  1 20:38:31 Runtop ifup: RTNETLINK answers: File exists\r\n这里有个错误,可能和你的问题无关,但和网络有关,检查一下的好\r\n\r\n另 cat /proc/net/route 看看是否有eth1的直联路由,\r\nifconfig eth1 down\r\nroute -n\r\n----------------\r\nifconfig eth1 up\r\nroute -n\r\n比较两个输出

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
7 [报告]
发表于 2008-07-02 09:24 |只看该作者
ifconfig -a \r\n帖结果,看看别的接口。

论坛徽章:
0
8 [报告]
发表于 2008-07-02 18:00 |只看该作者
[root@Runtop ~]# route\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     *               255.255.255.0   U     0      0        0 eth0\r\ndefault         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]# ifconfig eth1 down\r\n[root@Runtop ~]# route -n\r\nKernel IP routing table\r\nDestination     Gateway         Genmask         Flags Metric Ref    Use Iface\r\n192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0\r\n0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0\r\n[root@Runtop ~]#

论坛徽章:
0
9 [报告]
发表于 2008-07-02 18:30 |只看该作者
两天了,还是没想通,帮帮忙,\r\n\r\n\r\n[root@Runtop ~]# ifconfig -a\r\neth0      Link encap:Ethernet  HWaddr 00:14:BF:5D:6E:15  \r\n          inet addr:192.168.1.89  Bcast:192.168.1.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::214:bfff:fe5d:6e15/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:942 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:543 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:74333 (72.5 KiB)  TX bytes:57138 (55.7 KiB)\r\n          Interrupt:10 Base address:0x6000 \r\n\r\neth1      Link encap:Ethernet  HWaddr 00:18:F8:08:BA:57  \r\n          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0\r\n          inet6 addr: fe80::218:f8ff:fe08:ba57/64 Scope:Link\r\n          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1\r\n          RX packets:38 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:4 errors:32 dropped:0 overruns:0 carrier:64\r\n          collisions:0 txqueuelen:1000 \r\n          RX bytes:4679 (4.5 KiB)  TX bytes:1100 (1.0 KiB)\r\n          Interrupt:11 Base address:0xa000 \r\n\r\nlo        Link encap:Local Loopback  \r\n          inet addr:127.0.0.1  Mask:255.0.0.0\r\n          inet6 addr: ::1/128 Scope:Host\r\n          UP LOOPBACK RUNNING  MTU:16436  Metric:1\r\n          RX packets:1761 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:1761 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:2770556 (2.6 MiB)  TX bytes:2770556 (2.6 MiB)\r\n\r\nsit0      Link encap:IPv6-in-IPv4  \r\n          NOARP  MTU:1480  Metric:1\r\n          RX packets:0 errors:0 dropped:0 overruns:0 frame:0\r\n          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\r\n          collisions:0 txqueuelen:0 \r\n          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)\r\n\r\n[root@Runtop ~]# \n\n[ 本帖最后由 tiansky 于 2008-7-2 18:39 编辑 ]

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
10 [报告]
发表于 2008-07-03 10:42 |只看该作者
TX packets:4 errors:32\r\n\r\n\r\n错误这么高。查网线,换网卡,换对端交换机。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP