免费注册 查看新帖 |

Chinaunix

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

linux路由器实验中遇到的麻烦问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-14 20:46 |只看该作者 |倒序浏览
在下最近接到老大的命令,要做一个linux路由器,系统版本是redhat9,我考虑了两个办法:1、使用纯linux做静态路由;2、用linux+zebra做静态路由。
试验中我在机器上接了4个网卡,但是只用了两个网卡做测试,一个是eth0,一个是eth1,ifconfig分别是:
[root@localhost root]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:40:05:45:20:05  
          inet addr:172.16.65.254  Bcast:172.16.65.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:363437 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4094 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:22293822 (21.2 Mb)  TX bytes:453958 (443.3 Kb)
          Interrupt:9 Base address:0xc000

eth1      Link encap:Ethernet  HWaddr 00:40:05:42:11:92  
          inet addr:10.0.0.254  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:48 errors:0 dropped:0 overruns:0 frame:0
          TX packets:414 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:4286 (4.1 Kb)  TX bytes:22216 (21.6 Kb)
          Interrupt:5 Base address:0xc400
1、纯linux静态路由:
显示路由表内容如下:
[root@localhost root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.255.255.0   U     0      0        0 eth1
172.16.65.0     *               255.255.255.0   U     0      0        0 eth0
172.16.0.0      *               255.255.255.0   U     0      0        0 eth2
172.16.1.0      *               255.255.255.0   U     0      0        0 eth3
169.254.0.0     *               255.255.0.0     U     0      0        0 eth3
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         10.0.0.1        0.0.0.0         UG    0      0        0 eth1

请各位达人帮忙看看这个配置有没有问题,实际实验中从172.16.65.54/24无法ping通10.0.0.1(10.0.0.1/24是ns-25的内网口),麻烦各位帮我看看问题出在哪儿。
2、linux+zebra路由:
考虑到我们的网络规模不是很大,所以我没有启动bgp和ospf,只是在zebra里配置了纯静态路由,showrun信息如下:
misroute# sh run

Current configuration:
!
hostname misroute
password mis
enable password mis
log file /var/log/zebra/zebra.log
!
interface lo
!
interface eth0
description interface to external network
ip address 172.16.65.254/24
!
interface eth1
description interface to internal network
ip address 10.0.0.254/24
!
interface eth2
!
interface eth3
!
ip route 10.0.0.0/24 172.16.65.0
ip route 172.16.65.0/24 10.0.0.0
!
!
line vty
!
end

sh int如下:
misroute# sh int
Interface lo
  index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING>;
  inet 127.0.0.1/8
    input packets 3357, bytes 213313, dropped 0, multicast packets 0
    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0
    output packets 3357, bytes 213313, dropped 0
    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0
    collisions 0
Interface eth0
  Description: interface to external network
  index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>;
  HWaddr: 00:40:05:45:20:05
  inet 172.16.65.254/24 broadcast 172.16.65.255
    input packets 542936, bytes 33191449, dropped 0, multicast packets 0
    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0
    output packets 4389, bytes 479687, dropped 0
    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0
    collisions 0
Interface eth1
  Description: interface to internal network
  index 3 metric 1 mtu 1500 <UP,BROADCAST,MULTICAST>;
  HWaddr: 00:40:05:42:11:92
  inet 10.0.0.254/24 broadcast 10.0.0.255
    input packets 48, bytes 4286, dropped 0, multicast packets 0
    input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0
    output packets 414, bytes 22216, dropped 0
    output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0
    collisions 0

不知道zebra是不是必须启动bgpd或ospfd进程才能正常工作,还是我的这个配置有问题,麻烦各位指点一二,小弟已经为这问题痛苦了好多天了,离老大规定的交货日期也越来越进,只能求助这里的高手了,感激不尽!

论坛徽章:
0
2 [报告]
发表于 2004-09-15 08:05 |只看该作者

linux路由器实验中遇到的麻烦问题

哪位高手可以帮我看一下的?小弟感激不尽!!
补充一下:zebra的路由表如下:
misroute# sh ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       B - BGP, >; - selected route, * - FIB route

K>;* 0.0.0.0/0 via 10.0.0.1, eth1
S   10.0.0.0/24 [1/0] via 172.16.65.0, eth0
K * 10.0.0.0/24 is directly connected, eth1
C>;* 10.0.0.0/24 is directly connected, eth1
K * 127.0.0.0/8 is directly connected, lo
C>;* 127.0.0.0/8 is directly connected, lo
K>;* 169.254.0.0/16 is directly connected, eth3
K * 172.16.0.0/24 is directly connected, eth2
C>;* 172.16.0.0/24 is directly connected, eth2
K * 172.16.1.0/24 is directly connected, eth3
C>;* 172.16.1.0/24 is directly connected, eth3
S   172.16.65.0/24 [1/0] via 10.0.0.0, eth1
K * 172.16.65.0/24 is directly connected, eth0
C>;* 172.16.65.0/24 is directly connected, eth0


所有的物理连接均无问题。

论坛徽章:
0
3 [报告]
发表于 2004-09-15 08:11 |只看该作者

linux路由器实验中遇到的麻烦问题

试试从172.16.65.54 ping 10.0.0.254

论坛徽章:
0
4 [报告]
发表于 2004-09-15 08:19 |只看该作者

linux路由器实验中遇到的麻烦问题

可以ping通,因为10.0.0.254和172.16.65.254是接在一个机器上。

论坛徽章:
0
5 [报告]
发表于 2004-09-15 08:25 |只看该作者

linux路由器实验中遇到的麻烦问题

是172.16.65.54 不是172.16.65.254
应该是172.16.65.0/24上的另外一台机器吧。另外你要ns-25有返回,它的路由有指向你的linux上吗?

论坛徽章:
0
6 [报告]
发表于 2004-09-15 09:08 |只看该作者

linux路由器实验中遇到的麻烦问题

没有这个必要吧?

论坛徽章:
0
7 [报告]
发表于 2004-09-15 09:10 |只看该作者

linux路由器实验中遇到的麻烦问题

简单的结构如下:
172.16.65.65/24(windows PC)--------172.16.65.254/24(eth0)(eth1)10.0.0.254--------10.0.0.1/24(ns-25)

论坛徽章:
0
8 [报告]
发表于 2004-09-15 09:32 |只看该作者

linux路由器实验中遇到的麻烦问题

我的意思是:如果从172.16.65.65/24(windows PC)能ping
(eth1)10.0.0.254的话说明linux的route是正确的。

论坛徽章:
0
9 [报告]
发表于 2004-09-15 10:12 |只看该作者

linux路由器实验中遇到的麻烦问题

显示路由表内容如下:
[root@localhost root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth1
172.16.65.0 * 255.255.255.0 U 0 0 0 eth0
172.16.0.0 * 255.255.255.0 U 0 0 0 eth2
172.16.1.0 * 255.255.255.0 U 0 0 0 eth3
169.254.0.0 * 255.255.0.0 U 0 0 0 eth3
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 10.0.0.1 0.0.0.0 UG 0 0 0 eth1

论坛徽章:
0
10 [报告]
发表于 2004-09-15 13:36 |只看该作者

linux路由器实验中遇到的麻烦问题

求助···顶上来再说
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP