[root@localhost ~]# systemctl start zebra [root@localhost ~]# vtysh Hello, this is Quagga (version 0.99.22.4). Copyright 1996-2005 Kunihiro Ishiguro, et al. localhost.localdomain# configure terminal localhost.localdomain(config)# log file /var/log/quagga/quagga.log localhost.localdomain(config)# exit localhost.localdomain# write Building Configuration... Configuration saved to /etc/quagga/zebra.conf [OK] localhost.localdomain# exit [root@localhost ~]# vtysh Hello, this is Quagga (version 0.99.22.4). Copyright 1996-2005 Kunihiro Ishiguro, et al. localhost.localdomain# interface enahisic2i0 % Unknown command. localhost.localdomain# configure terminal localhost.localdomain(config)# interface enahisic2i0 localhost.localdomain(config-if)# description "to Router-B" localhost.localdomain(config-if)# show interface description % Unknown command. localhost.localdomain(config-if)# exit localhost.localdomain(config)# show interface % Unknown command. localhost.localdomain(config)# exit localhost.localdomain# show interface Interface brqe00c4e3a-36 is up, line protocol detection is d isabled index 7 metric 1 mtu 1500 flags: <UP,BROADCAST,RUNNING,MULTICAST> HWaddr: 22:d5:0c:11:57:9b inet 172.16.100.99/24 inet6 fe80::ec8d:54ff:fed6:827d/64 Interface enahisic2i0 is up, line protocol detection is disa bled Description: "to Router-B" index 2 metric 1 mtu 1500 flags: <UP,BROADCAST,RUNNING,MULTICAST> HWaddr: 48:57:02:64:ea:1b inet 10.10.16.81/24 localhost.localdomain# show interface description Interface Status Protocol Description brqe00c4e3a-36 up unknown enahisic2i0 up unknown "to Router-B" enahisic2i1 up unknown enahisic2i2 up unknown enahisic2i3 up unknown lo up unknown tap10dcfcba-44 up unknown virbr0 up unknown virbr0-nic down down vnet0 up unknown localhost.localdomain#
[root@localhost ~]# service bgpd start Redirecting to /bin/systemctl start bgpd.service [root@localhost ~]# vtysh Hello, this is Quagga (version 0.99.22.4). Copyright 1996-2005 Kunihiro Ishiguro, et al. localhost.localdomain# show running-config Building configuration... Current configuration: ! hostname localhost.localdomain log file /var/log/quagga/quagga.log ! interface brqe00c4e3a-36 ipv6 nd suppress-ra ! interface enahisic2i0 description "to Router-B" ipv6 nd suppress-ra ! interface enahisic2i1 ipv6 nd suppress-ra ! interface enahisic2i2 end localhost.localdomain# configure terminal
localhost.localdomain# configure terminal
localhost.localdomain(config)# router bgp 81
localhost.localdomain(config-router)# bgp router-id 10.10.16.81
localhost.localdomain(config-router)# neighbor 10.10.16.82 remote-as 82
localhost.localdomain(config-router)# exit
localhost.localdomain(config)# exit
localhost.localdomain# write
Building Configuration...
Configuration saved to /etc/quagga/zebra.conf
[OK]
localhost.localdomain# show ip bgp summary
localhost.localdomain#
[root@kunpeng82 devuser]# vtysh
Hello, this is Quagga (version 0.99.22.4).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
kunpeng82.bogon# router bgp 82
% Unknown command.
kunpeng82.bogon# configure terminal
kunpeng82.bogon(config)# router bgp 82
kunpeng82.bogon(config-router)# bgp router-id 10.10.16.82
kunpeng82.bogon(config-router)# neighbor 10.10.16.81 remote-as 81
kunpeng82.bogon(config-router)# network 10.3.3.0/24
kunpeng82.bogon(config-router)# exit
kunpeng82.bogon(config)# exit
kunpeng82.bogon# show ip bgp summary
kunpeng82.bogon# show ip bgp summary
kunpeng82.bogon# exit
kunpeng82.bogon# exit
竟然什么都没有
[root@kunpeng82 devuser]# cat /etc/quagga/bgpd.conf
cat: /etc/quagga/bgpd.conf: No such file or directory
[root@kunpeng82 devuser]#
cp /usr/share/doc/quagga-0.99.22.4/bgpd.conf.sample /etc/quagga/bgpd.conf
service bgpd restart
2 配置网络
localhost.localdomain# configure terminal localhost.localdomain(config)# network 10.2.2.2/24 % Unknown command. localhost.localdomain(config)# router bgp 81 localhost.localdomain(config-router)# network 10.2.2.2/24 localhost.localdomain(config-router)# exit localhost.localdomain(config)# write % Unknown command. localhost.localdomain(config)# exit localhost.localdomain# write Building Configuration... Configuration saved to /etc/quagga/zebra.conf Can't backup old configuration file /etc/quagga/bgpd.conf.sav. [OK] localhost.localdomain# show ip bgp summary BGP router identifier 10.10.16.81, local AS number 81 RIB entries 1, using 112 bytes of memory Peers 1, using 4560 bytes of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ U p/Down State/PfxRcd 10.10.16.82 4 82 4 6 0 0 0 0 0:02:37 0 Total number of neighbors 1 localhost.localdomain# localhost.localdomain# show ip bgp BGP table version is 0, local router ID is 10.10.16.81 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S Stale, R Removed Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 10.2.2.0/24 0.0.0.0 0 32768 i Total number of prefixes 1 localhost.localdomain#
localhost.localdomain# show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, A - Babel, > - selected route, * - FIB route K>* 0.0.0.0/0 via 10.10.16.254, enahisic2i0 C>* 10.10.16.0/24 is directly connected, enahisic2i0 C>* 127.0.0.0/8 is directly connected, lo C>* 172.16.100.0/24 is directly connected, brqe00c4e3a-36 C>* 172.18.100.0/24 is directly connected, enahisic2i1 localhost.localdomain# show ip route bgp
2.2 给82节点添加网络
[root@kunpeng82 ovs]# vtysh Hello, this is Quagga (version 0.99.22.4). Copyright 1996-2005 Kunihiro Ishiguro, et al. kunpeng82.bogon# configure terminal kunpeng82.bogon(config)# network 10.3.3.3/24 % Unknown command. kunpeng82.bogon(config)# router bgp 82 kunpeng82.bogon(config-router)# network 10.3.3.3/24 kunpeng82.bogon(config-router)# exit kunpeng82.bogon(config)# exit kunpeng82.bogon# show ip bgp summary BGP router identifier 10.10.16.82, local AS number 82 RIB entries 3, using 336 bytes of memory Peers 1, using 4560 bytes of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ U p/Down State/PfxRcd 10.10.16.81 4 81 9 12 0 0 0 0 0:07:55 1 Total number of neighbors 1 kunpeng82.bogon# show ip route bgp Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, A - Babel, > - selected route, * - FIB route B>* 10.2.2.0/24 [20/0] via 10.10.16.81, enahisic2i0, 00:05:4 1
2.3 再次查看81节点
localhost.localdomain# show ip route bgp localhost.localdomain# show ip route bgp Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, A - Babel, > - selected route, * - FIB route B>* 10.3.3.0/24 [20/0] via 10.10.16.82, enahisic2i0, 00:02:3 0
localhost.localdomain# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, A - Babel,
> - selected route, * - FIB route
K>* 0.0.0.0/0 via 10.10.16.254, enahisic2i0
B>* 10.3.3.0/24 [20/0] via 10.10.16.82, enahisic2i0, 00:42:0
9
C>* 10.10.16.0/24 is directly connected, enahisic2i0
C>* 127.0.0.0/8 is directly connected, lo
C>* 172.16.100.0/24 is directly connected, brqe00c4e3a-36
C>* 172.18.100.0/24 is directly connected, enahisic2i1
2.4 查看81节点 route
[root@localhost ~]# ip route list default via 10.10.16.254 dev enahisic2i0 10.3.3.0/24 via 10.10.16.82 dev enahisic2i0 proto zebra 10.10.16.0/24 dev enahisic2i0 proto kernel scope link src 10.10.16.81 172.16.100.0/24 dev brqe00c4e3a-36 proto kernel scope link src 172.16.100.99 172.18.100.0/24 dev enahisic2i1 proto kernel scope link src 172.18.100.81