Quagga 是开源的软路由,运行在 Linux 系统上,让 Linux 系统支持 OSPF 等路由协议和 routemap 等路由策略。
1 、安装
Quagga 官网:http://www.nongnu.org/quagga/
CentOS7 中,安装 Quagga 使用 yum 安装即可
yum install quagga
而在 CentOS7 中,由于 SELINUX 的存在,所以需要额外配置一下允许 Quagga 进程对本地磁盘的操作
setsebool -P zebra_write_config 1
安装好后,复制 Quagga 的配置文件模板并将 Quagga 设置为开机启动和运行 Quagga 。(XXXXX 为版本号,输入时请使用 Tab 补全)
cp /usr/share/doc/quagga-XXXXX/zebra.conf.sample /etc/quagga/zebra.conf systemctl enable zebra.service systemctl start zebra.service
2 、调试
Quagga 需要 vtysh 命令进入路由器模式,并且由于首次使用,建议创建一个日志文件。
Router# configure terminal Router(config)# log file /var/log/quagga/quagga.log Router(config)# exit Router# write
Quagga 的命令格式和 Cisco 基本一致,所以可以使用以下命令查看路由器状态
查看当前所有端口信息 Router# show interface 查看当前运行配置 Router# show running-config 查看当前路由表 Router# show ip route 查看当前 Quagga 版本号 Router# show version
3 、命令表
Quagga 的命令不多,所以在这贴几份命令表
第一份是 Router#?
第二份是 Router#show ?
第三份是 Router(config)#?
clear | Reset functions |
configure | Configuration from vty interface |
copy | Copy from one file to another |
debug | Enable debug messages for specific or all part. |
disable | Turn off privileged mode command |
end | End current mode and change to enable mode |
exit | Exit current mode and down to previous mode |
list | Print command list |
no | Negate a command or set its defaults |
ping | Send echo messages |
quit | Exit current mode and down to previous mode |
show | Show running system information |
ssh | Open an ssh connection |
start-shell | Start UNIX shell |
telnet | Open a telnet connection |
terminal | Set terminal line parameters |
traceroute | Trace route to destination |
undebug | Disable debugging functions (see also 'debug') |
write | Write running configuration to memory, network, or terminal |
babel | IP information |
bgp | BGP information |
daemons | Show list of running daemons |
debugging | State of each debugging option |
interface | Interface status and configuration |
ip | IP information |
ipv6 | IPv6 information |
isis | IS-IS information |
logging | Show current logging configuration |
memory | Memory statistics |
mpls-te | MPLS-TE information |
route-map | route-map information |
running-config | Current operating configuration |
startup-config | Contentes of startup configuration |
table | default routing table to use for all clients |
version | Displays zebra version |
zebra | Zebra information |
access-list | Add an access list entry |
bgp | BGP information |
debug | Enable debug messages for specific or all part. |
dump | Dump packet |
enable | Modify enable password parameters |
end | End current mode and change to enable mode |
exit | Exit current mode and down to previous mode |
hostname | Set system's network name |
interface | Select an interface to configure |
ip | IP information |
ipv6 | IPv6 information |
key | Authentication key management |
line | Configure a terminal line |
list | Print command list |
log | Logging control |
no | Negate a command or set its defaults |
password | Assign the terminal connection password |
route-map | Create route-map or enter route-map command mode |
router | Enable a routing process |
router-id | Manually set the router-id |
service | Set up miscellaneous service |
table | Configure target kernel routing table |
username |
参考:https://linux.cn/article-4232-1.html