シナプス技術者ブログ

シナプスの技術者公式ブログ。インターネットで、鹿児島の毎日を笑顔にします。

Cisco IOS と VyOSの設定比較をしてみた。

シナプスの技術部ネットワーク課の末吉と申します。

弊社ではネットワーク機器としてほぼCisco(少しだけYAMAHA)を使用して運用しています。 業務でVyOS に触る機会がありましたので、簡単にCiscoとVyOSの設定を比較してみました。

検証環境

ネットワーク構成

f:id:ksueyoshi:20191112160053p:plain

図のインターフェイス名はCiscoになります。 VyOSの場合は Gi0/0をeth0, Gi1/0をeth1と読替えてください。

Cisco

IOS 15.2(4)M11
GNS3上で稼働
本記事では、設定投入はグローバルコンフィグレーションモード、確認は特権モードで実施しています。

Catalyst 2960 スイッチ コマンド リファレンス, 12.2(50)SE

VyOS

VyOS 1.1.8
KVM上で稼働
本記事では、設定投入、確認共に設定モードで実施しています。

ユーザーズガイド

ホスト名

設定する機器がわかりやすい様にホスト名を設定します。 f:id:ksueyoshi:20191112160047j:plain

Cisco

  • 設定
[R1]
Router(config)#hostname R1
R1(config)#

[R2]
Router(config)#hostname R2
R2(config)#
  • 設定確認
R1#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+hostname R1
-hostname Router


R2#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+hostname R2
-hostname Router

VyOS

[R1]
vyos@vyos# set system host-name R1

[R2]
vyos@vyos# set system host-name R2
  • 設定確認
[R1]
vyos@vyos# show system host-name
>host-name R1

[R2]
vyos@vyos# show system host-name
>host-name R2
  • 反映
[R1]
vyos@vyos# commit
[ system host-name R1 ]
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.

[R2]
vyos@vyos# commit
[ system host-name R2 ]
Stopping enhanced syslogd: rsyslogd.
Starting enhanced syslogd: rsyslogd.

プロンプトにも反映させるため一度ログアウトします。

vyos@vyos# exit
Warning: configuration changes have not been saved.
exit
vyos@vyos:~$ exit
logout

Welcome to VyOS - R1 ttyS0

R1 login:

IPアドレス

IPアドレスを設定し、R1/R2 で疎通確認を行います。 f:id:ksueyoshi:20191112180813p:plain

Cisco

  • IPアドレス設定
[R1]
R1(config)#interface GigabitEthernet 0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#interface GigabitEthernet 1/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown

[R2]
R2(config)#interface GigabitEthernet 0/0
R2(config-if)#ip address 192.168.0.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#interface GigabitEthernet 1/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0
R2(config-if)#no shutdown
  • 設定確認
R1#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
interface GigabitEthernet0/0
 +ip address 192.168.0.1 255.255.255.252
interface GigabitEthernet1/0
 +ip address 192.168.1.1 255.255.255.0
interface GigabitEthernet0/0
 -no ip address
 -shutdown
interface GigabitEthernet1/0
 -no ip address
 -shutdown


R2#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
interface GigabitEthernet0/0
 +ip address 192.168.0.2 255.255.255.252
interface GigabitEthernet1/0
 +ip address 192.168.2.2 255.255.255.0
interface GigabitEthernet0/0
 -no ip address
 -shutdown
interface GigabitEthernet1/0
 -no ip address
 -shutdown
  • 疎通確認
R1#ping 192.168.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/24/32 ms


R2#ping 192.168.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/48/152 ms

VyOS

  • IPアドレス設定
[R1]
vyos@R1# set interfaces ethernet eth0 address 192.168.0.1/30
vyos@R1# set interfaces ethernet eth1 address 192.168.1.1/24

[R2]
vyos@R2# set interfaces ethernet eth0 address 192.168.0.2/30
vyos@R2# set interfaces ethernet eth1 address 192.168.2.2/24
  • 設定確認
[R1]
vyos@R1# show interfaces
 ethernet eth0 {
+    address 192.168.0.1/30
     hw-id 54:52:00:d0:b6:dd
 }
 ethernet eth1 {
+    address 192.168.1.1/24
     hw-id 54:52:00:a8:b6:dd
 }
 loopback lo {
 }


[R2]
vyos@R2# show interfaces
 ethernet eth0 {
+    address 192.168.0.2/30
     hw-id 54:52:00:d0:b6:de
 }
 ethernet eth1 {
+    address 192.168.2.2/24
     hw-id 54:52:00:a8:b6:de
 }
 loopback lo {
 }
  • 反映
[R1]
vyos@R1# commit

[R2]
vyos@R2# commit
  • 疎通確認
[R1]
vyos@R1# run ping 192.168.0.2 count 5
PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
64 bytes from 192.168.0.2: icmp_req=1 ttl=64 time=0.857 ms
64 bytes from 192.168.0.2: icmp_req=2 ttl=64 time=0.247 ms
64 bytes from 192.168.0.2: icmp_req=3 ttl=64 time=0.287 ms
64 bytes from 192.168.0.2: icmp_req=4 ttl=64 time=0.297 ms
64 bytes from 192.168.0.2: icmp_req=5 ttl=64 time=0.287 ms

--- 192.168.0.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.247/0.395/0.857/0.231 ms

[R2]
vyos@R2# run ping 192.168.0.1 count 5
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_req=1 ttl=64 time=0.302 ms
64 bytes from 192.168.0.1: icmp_req=2 ttl=64 time=0.295 ms
64 bytes from 192.168.0.1: icmp_req=3 ttl=64 time=0.214 ms
64 bytes from 192.168.0.1: icmp_req=4 ttl=64 time=0.274 ms
64 bytes from 192.168.0.1: icmp_req=5 ttl=64 time=0.337 ms

--- 192.168.0.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 0.214/0.284/0.337/0.043 ms

OSPF

IPアドレス設定だけではR1から R2の192.168.2.2, R2からR1の192.168.1.1 への疎通は取れない為、OSPFで経路交換をし疎通確認を行ってみます。 f:id:ksueyoshi:20191112180806p:plain

Cisco

  • 設定
R1(config)#router ospf 1
R1(config-router)#network 192.168.0.0 0.0.0.3 area 0
R1(config-router)#network 192.168.1.0 0.0.0.255 area 0

R2(config)#router ospf 1
R2(config-router)#network 192.168.0.0 0.0.0.3 area 0
R2(config-router)#network 192.168.2.0 0.0.0.255 area 0
  • 設定確認
[R1]
R1#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+router ospf 1
 +network 192.168.0.0 0.0.0.3 area 0
 +network 192.168.1.0 0.0.0.255 area 0

[R2]
R2#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+router ospf 1
 +network 192.168.0.0 0.0.0.3 area 0
 +network 192.168.2.0 0.0.0.255 area 0
  • OSPF確認
・ネイバー確認
[R1]
R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.2       1   FULL/DR         00:00:34    192.168.0.2     GigabitEthernet0/0

[R2]
R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.1.1       1   FULL/BDR        00:00:32    192.168.0.1     GigabitEthernet0/0


・経路確認
[R1]
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.0.0/30 is directly connected, GigabitEthernet0/0
L        192.168.0.1/32 is directly connected, GigabitEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet1/0
L        192.168.1.1/32 is directly connected, GigabitEthernet1/0
O     192.168.2.0/24 [110/2] via 192.168.0.2, 00:00:28, GigabitEthernet0/0

[R2]
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.0.0/30 is directly connected, GigabitEthernet0/0
L        192.168.0.2/32 is directly connected, GigabitEthernet0/0
O     192.168.1.0/24 [110/2] via 192.168.0.1, 00:00:31, GigabitEthernet0/0
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, GigabitEthernet1/0
L        192.168.2.2/32 is directly connected, GigabitEthernet1/0

・疎通確認
[R1]
R1#ping 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/44/96 ms

[R2]
R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/28 ms

VyOS

  • 設定
[R1]
vyos@R1# set protocols ospf area 0 network 192.168.0.0/30
vyos@R1# set protocols ospf area 0 network 192.168.1.0/24

[R2]
vyos@R2# set protocols ospf area 0 network 192.168.0.0/30
vyos@R2# set protocols ospf area 0 network 192.168.2.0/24
  • 設定確認
[R1]
vyos@R1# show protocols
+ospf {
+    area 0 {
+        network 192.168.0.0/30
+        network 192.168.1.0/24
+    }
+}

[R2]
vyos@R2# show protocols
+ospf {
+    area 0 {
+        network 192.168.0.0/30
+        network 192.168.2.0/24
+    }
+}
  • 反映
[R1]
vyos@R1# commit

[R2]
vyos@R2# commit
  • OSPF確認
・ネイバー確認
[R1]
vyos@R1# run show ip ospf neighbor

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
192.168.0.2       1 Full/DR           38.648s 192.168.0.2     eth0:192.168.0.1         0     0     0

[R2]
vyos@R2# run show ip ospf neighbor

    Neighbor ID Pri State           Dead Time Address         Interface            RXmtL RqstL DBsmL
192.168.0.1       1 Full/Backup       31.981s 192.168.0.1     eth0:192.168.0.2         0     0     0

・経路確認
[R1]
vyos@R1# run show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
O   192.168.0.0/30 [110/10] is directly connected, eth0, 00:02:50
C>* 192.168.0.0/30 is directly connected, eth0
O   192.168.1.0/24 [110/10] is directly connected, eth1, 00:02:50
C>* 192.168.1.0/24 is directly connected, eth1
O>* 192.168.2.0/24 [110/20] via 192.168.0.2, eth0, 00:01:56

[R2]
vyos@R2# run show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,
       I - ISIS, B - BGP, > - selected route, * - FIB route

C>* 127.0.0.0/8 is directly connected, lo
O   192.168.0.0/30 [110/10] is directly connected, eth0, 00:02:16
C>* 192.168.0.0/30 is directly connected, eth0
O>* 192.168.1.0/24 [110/20] via 192.168.0.1, eth0, 00:01:26
O   192.168.2.0/24 [110/10] is directly connected, eth1, 00:02:16
C>* 192.168.2.0/24 is directly connected, eth1

・疎通確認
[R1]
vyos@R1# run ping 192.168.2.2 count 5
PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data.
64 bytes from 192.168.2.2: icmp_req=1 ttl=64 time=0.461 ms
64 bytes from 192.168.2.2: icmp_req=2 ttl=64 time=0.300 ms
64 bytes from 192.168.2.2: icmp_req=3 ttl=64 time=0.210 ms
64 bytes from 192.168.2.2: icmp_req=4 ttl=64 time=0.244 ms
64 bytes from 192.168.2.2: icmp_req=5 ttl=64 time=0.215 ms

--- 192.168.2.2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 0.210/0.286/0.461/0.093 ms

[R2]
vyos@R2# run ping 192.168.1.1 count 5
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=0.314 ms
64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=0.231 ms
64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.311 ms
64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=0.242 ms
64 bytes from 192.168.1.1: icmp_req=5 ttl=64 time=0.275 ms

--- 192.168.1.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 0.231/0.274/0.314/0.038 ms

BGP

BGP(eBGP)でBGPピアをし、ピア、経路広報、経路受信確認を行います。 f:id:ksueyoshi:20191112180758p:plain

Cisco

  • 設定
[R1]
R1(config)#router bgp 64496
R1(config-router)#network 192.168.1.0 
R1(config-router)#neighbor AS64497_R2 peer-group
R1(config-router)#neighbor AS64497_R2 remote-as 64497
R1(config-router)#neighbor AS64497_R2 soft-reconfiguration inbound
R1(config-router)#neighbor 192.168.0.2 peer-group AS64497_R2

[R2]
R2(config)#router bgp 64497
R2(config-router)#network 192.168.2.0
R2(config-router)#neighbor AS64496_R1 peer-group
R2(config-router)#neighbor AS64496_R1 remote-as 64496
R2(config-router)#neighbor AS64496_R1 soft-reconfiguration inbound
R2(config-router)#neighbor 192.168.0.1 peer-group AS64496_R1
  • 設定確認
[R1]
R1#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+router bgp 64496
 +bgp log-neighbor-changes
 +network 192.168.1.0
 +neighbor AS64497_R2 peer-group
 +neighbor AS64497_R2 remote-as 64497
 +neighbor AS64497_R2 soft-reconfiguration inbound
 +neighbor 192.168.0.2 peer-group AS64497_R2

[R2]
R2#show archive config differences nvram:startup-config system:running-config
!Contextual Config Diffs:
+router bgp 64497
 +bgp log-neighbor-changes
 +network 192.168.2.0
 +neighbor AS64496_R1 peer-group
 +neighbor AS64496_R1 remote-as 64496
 +neighbor AS64496_R1 soft-reconfiguration inbound
 +neighbor 192.168.0.1 peer-group AS64496_R1
  • BGP確認
・BGPピア
[R1]
R1#show ip bgp summary
BGP router identifier 192.168.1.1, local AS number 64496
BGP table version is 3, main routing table version 3
2 network entries using 296 bytes of memory
2 path entries using 128 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 720 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.0.2     4        64497       6       6        3    0    0 00:01:47        1


[R2]
2#show ip bgp summary
BGP router identifier 192.168.2.2, local AS number 64497
BGP table version is 3, main routing table version 3
2 network entries using 296 bytes of memory
2 path entries using 128 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 720 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.0.1     4        64496       6       6        3    0    0 00:01:43        1

・経路広報
[R1]
R1#show ip bgp neighbors 192.168.0.2 advertised-routes
BGP table version is 3, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.1.0      0.0.0.0                  0         32768 i

Total number of prefixes 1


[R2]
R2#show ip bgp neighbors  192.168.0.1 advertised-routes
BGP table version is 3, local router ID is 192.168.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.2.0      0.0.0.0                  0         32768 i

Total number of prefixes 1

・経路受信
[R1]
R1#show ip bgp neighbors 192.168.0.2 received-routes
BGP table version is 3, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.2.0      192.168.0.2              0             0 64497 i

Total number of prefixes 1


[R2]
R2#show ip bgp neighbors  192.168.0.1 received-routes
BGP table version is 3, local router ID is 192.168.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  192.168.1.0      192.168.0.1              0             0 64496 i

Total number of prefixes 1

VyOS

  • 設定
[R1]
vyos@R1# set protocols bgp 64496 neighbor 192.168.0.2 peer-group AS64497_R2
vyos@R1# set protocols bgp 64496 network 192.168.1.0/24
vyos@R1# set protocols bgp 64496 peer-group AS64497_R2 remote-as 64497
vyos@R1# set protocols bgp 64496 peer-group AS64497_R2 soft-reconfiguration inbound

[R2]
vyos@R2# set protocols bgp 64497 neighbor 192.168.0.1 peer-group AS64496_R1
vyos@R2# set protocols bgp 64497 network 192.168.2.0/24
vyos@R2# set protocols bgp 64497 peer-group AS64496_R1 remote-as 64496
vyos@R2# set protocols bgp 64497 peer-group AS64496_R1 soft-reconfiguration inbound
  • 設定確認
[R1]
vyos@R1# show protocols
+bgp 64496 {
+    neighbor 192.168.0.2 {
+        peer-group AS64497_R2
+    }
+    network 192.168.1.0/24 {
+    }
+    peer-group AS64497_R2 {
+        remote-as 64497
+        soft-reconfiguration {
+            inbound
+        }
+    }
+}
 ospf {
     area 0 {
         network 192.168.0.0/30
         network 192.168.1.0/24
     }
 }

[R2]
vyos@R2# show protocols
+bgp 64497 {
+    neighbor 192.168.0.1 {
+        peer-group AS64496_R1
+    }
+    network 192.168.2.0/24 {
+    }
+    peer-group AS64496_R1 {
+        remote-as 64496
+        soft-reconfiguration {
+            inbound
+        }
+    }
+}
 ospf {
     area 0 {
         network 192.168.0.0/30
         network 192.168.2.0/24
     }
 }
  • 反映
[R1]
vyos@R1# commit

[R2]
vyos@R2# commit
  • BGP確認
・BGPピア
[R1]
vyos@R1# run show ip bgp summary
BGP router identifier 192.168.0.1, local AS number 64496
IPv4 Unicast - max multipaths: ebgp 1 ibgp 1
RIB entries 3, using 288 bytes of memory
Peers 1, using 4560 bytes of memory
Peer groups 1, using 32 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.0.2     4 64497       2       4        0    0    0 00:00:41        1

Total number of neighbors 1

[R2]
vyos@R2# run show ip bgp summary
BGP router identifier 192.168.0.2, local AS number 64497
IPv4 Unicast - max multipaths: ebgp 1 ibgp 1
RIB entries 3, using 288 bytes of memory
Peers 1, using 4560 bytes of memory
Peer groups 1, using 32 bytes of memory

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.0.1     4 64496       4       5        0    0    0 00:01:52        1

Total number of neighbors 1

・経路広報
[R1]
vyos@R1# run show ip bgp neighbors 192.168.0.2 advertised-routes
BGP table version is 0, local router ID is 192.168.0.1
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
*> 192.168.1.0      192.168.0.1              1         32768 i

Total number of prefixes 1

[R2]
vyos@R2# run show ip bgp neighbors 192.168.0.1 advertised-routes
BGP table version is 0, local router ID is 192.168.0.2
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
*> 192.168.2.0      192.168.0.2              1         32768 i

Total number of prefixes 1

・経路受信
[R1]
vyos@R1# run show ip bgp neighbors 192.168.0.2 received-routes
BGP table version is 0, local router ID is 192.168.0.1
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
*> 192.168.2.0      192.168.0.2              1             0 64497 i

Total number of prefixes 1

[R2]
vyos@R2# run show ip bgp neighbors 192.168.0.1 received-routes
BGP table version is 0, local router ID is 192.168.0.2
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
*> 192.168.1.0      192.168.0.1              1             0 64496 i

Total number of prefixes 1

まとめ

ざっくりと、CiscoとVyOSで同じ設定を追ってみました。

  • VyOSは初めて触ったが、若干コンフィグの見方が違うくらい。
  • 確認コマンド等はCiscoと同じ感覚で出来た。
  • Ciscoは設定を入れると即反映されるが、VyOSは設定しても即反映ではなく手動で反映する必要がある。
  • VyOSではサブネットマスク/ワイルドカードではなくprefix での設定なので個人的にわかりやすかった(ワイルドカードはわかりにくい)

VyOSはKVMで手軽に動かす事ができ、色々出来る様なので今後も時間を見つけて触っていきたいと思います。