将你的 CentOS 变成 OSPF 路由器

2024-11-09 17:08:24

1、我们首先创建Zebra配置文件,并启用Zebra守护进程。# cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf # service zebra start # chkconfig zebra on启动vtysh命令行:#vtysh首先,我们为Zebra配置日志文件。输入下面的命令进入vtysh的全局配置模式:site-A-RTR# configure terminal指定日志文件位置,接着退出模式:site-A-RTR(config)# log file /var/log/quagga/quagga.log site-A-RTR(config)# exit永久保存配置:site-A-RTR# write接下来,我们要确定可用的接口并按需配置它们的IP地址。site-A-RTR# show interfaceInterface eth0 is up, line protocol detection is disabled . . . . . Interface eth1 is up, line protocol detection is disabled . . . . .配置eth0参数:site-A-RTR# configure terminal site-A-RTR(config)# interface eth0 site-A-RTR(config-if)# ip address 10.10.10.1/30 site-A-RTR(config-if)# description to-site-B site-A-RTR(config-if)# no shutdown继续配置eth1参数:site-A-RTR(config)# interface eth1 site-A-RTR(config-if)# ip address 192.168.1.1/24 site-A-RTR(config-if)# description to-site-A-LAN site-A-RTR(config-if)# no shutdown现在验证配置:site-A-RTR(config-if)# do show interfaceInterface eth0 is up, line protocol detection is disabled . . . . . inet 10.10.10.1/30 broadcast 10.10.10.3 . . . . . Interface eth1 is up, line protocol detection is disabled . . . . . inet 192.168.1.1/24 broadcast 192.168.1.255 . . . . .site-A-RTR(config-if)# do show interface descriptionInterface Status Protocol Description eth0 up unknown to-site-B eth1 up unknown to-site-A-LAN永久保存配置:site-A-RTR(config-if)# do write在site-B上重复上面配置IP地址的步骤。如果一切顺利,你应该可以在site-A的服务器上ping通site-B上的对等IP地址10.10.10.2了。注意:一旦Zebra的守护进程启动了,在vtysh命令行中的任何改变都会立即生效。因此没有必要在更改配置后重启Zebra守护进程。

猜你喜欢