- 论坛徽章:
- 0
|
在下最近接到老大的命令,要做一个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进程才能正常工作,还是我的这个配置有问题,麻烦各位指点一二,小弟已经为这问题痛苦了好多天了,离老大规定的交货日期也越来越进,只能求助这里的高手了,感激不尽! |
|