[YFJ] どちらのプロトコルも30年選手

[YFJ] どちらのプロトコルも30年選手

お世話になっております.チーム ictsc2024.otaku.zone です.

トラブル1

Router02 の設定との差分を見て,Router01 の設定に不足している箇所を調査しました.

その結果,Router01のroute-mapおよびprefix-listの設定が不足していることが原因であることが分かったためRouter01およびRouter02間で適切な経路交換を行えるように設定を変更します.

初期状態のRouter01のセッティング
Router01# show running-config
Building configuration...

Current configuration:
!
frr version 10.1.1
frr defaults traditional
hostname Router01
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
ip router-id 1.1.1.1
!
interface lo
 ip address 1.1.1.1/32
exit
!
router bgp 65001
 neighbor Router02 peer-group
 neighbor Router02 remote-as 65002
 neighbor 192.168.60.10 peer-group Router02
 neighbor 192.168.60.10 description Router02
 !
 address-family ipv4 unicast
  network 192.168.60.0/29
  neighbor Router02 soft-reconfiguration inbound
 exit-address-family
exit
!
end
Router01#
初期状態のRouter02のセッティング
Router02# show running-config
Building configuration...

Current configuration:
!
frr version 10.1.1
frr defaults traditional
hostname Router02
log syslog informational
no ipv6 forwarding
service integrated-vtysh-config
!
ip prefix-list A65001-PREFIX seq 1 permit 192.168.60.0/29
ip prefix-list A65002-PREFIX seq 1 permit 192.168.60.16/29
!
ip router-id 2.2.2.2
!
interface lo
 ip address 2.2.2.2/32
exit
!
router bgp 65002
 neighbor Router01 peer-group
 neighbor Router01 remote-as 65001
 neighbor 192.168.60.9 peer-group Router01
 neighbor 192.168.60.9 description Router01
 !
 address-family ipv4 unicast
  network 192.168.60.16/29
  neighbor Router01 soft-reconfiguration inbound
  neighbor Router01 route-map RMAP-IN in
  neighbor Router01 route-map RMAP-OUT out
 exit-address-family
exit
!
route-map RMAP-IN permit 1
 match ip address prefix-list A65001-PREFIX
exit
!
route-map RMAP-OUT permit 1
 match ip address prefix-list A65002-PREFIX
exit
!
end
Router02#

前提として,問題にあった ping が通らない問題を確認できました.

user@Server01:~$ ping -c 3 192.168.60.18
PING 192.168.60.18 (192.168.60.18) 56(84) bytes of data.

--- 192.168.60.18 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2047ms

user@Server01:~$ 

手順

1.

まず,コンフィグレーションモードに移行します.

user@Router01:~$ sudo vtysh 

Hello, this is FRRouting (version 10.1.1).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

Router01# configure terminal 

2. プレフィックスリストを作成

Router02との経路交換に必要なプレフィックスを許可するリストを作成します.

Router01(config)# ip prefix-list A65001-PREFIX seq 2 permit 192.168.60.0/29
Router01(config)# ip prefix-list A65002-PREFIX seq 2 permit 192.168.60.16/29

3. 受信用ルートマップの作成

Router02からの経路を制御するためのルートマップRMAP-INを作成します.
RMAP-INは,A65002-PREFIXに一致する経路のみを受け入れる設定です.

Router01(config)# route-map RMAP-IN permit 2
Router01(config-route-map)# match ip address prefix-list A65002-PREFIX 
Router01(config-route-map)# exit 

4. 送信用ルートマップの作成

Router01がRouter02にアドバタイズする経路を制御するためのルートマップRMAP-OUTを作成します.
RMAP-OUTは,A65001-PREFIXに一致する経路のみをアドバタイズする設定です.

Router01(config)# route-map RMAP-OUT permit 2
Router01(config-route-map)# match ip address prefix-list A65001-PREFIX 
Router01(config-route-map)# exit 

5. BGP設定にルートマップを適用

Router01のBGP設定に戻り,作成したルートマップを適用します.

Router01(config-router)# address-family ipv4 unicast
Router01(config-router-af)# neighbor Router02 route-map RMAP-IN in
Router01(config-router-af)# neighbor Router02 route-map RMAP-OUT out
Router01(config-router-af)# exit
Router01(config-router)# exit
Router01(config)# exit

6. 設定を保存

設定を保存して永続化します.

Router01# write memory

7. BGP経路の確認

BGPテーブルに必要な経路が正しく登録されていることを確認します.

Router01# show ip bgp
BGP table version is 2, local router ID is 1.1.1.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, u unsorted, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
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.60.0/29  0.0.0.0                  0         32768 i
 *>  192.168.60.16/29 192.168.60.10            0             0 65002 i

Displayed 2 routes and 2 total paths
Router01#

8. 確認

問題が解消されたか確認するため,Server01からServer02にpingを送信します.

user@Server01:~$ ping -c 3 192.168.60.18
PING 192.168.60.18 (192.168.60.18) 56(84) bytes of data.
64 bytes from 192.168.60.18: icmp_seq=1 ttl=63 time=0.517 ms
64 bytes from 192.168.60.18: icmp_seq=2 ttl=63 time=0.513 ms
From 192.168.60.1: icmp_seq=3 Redirect Host(New nexthop: 192.168.60.10)
64 bytes from 192.168.60.18: icmp_seq=3 ttl=63 time=0.685 ms

--- 192.168.60.18 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2043ms
rtt min/avg/max/mdev = 0.513/0.571/0.685/0.080 ms
user@Server01:~$ 

解説

解説

この手順では,以下の点を解決しました.

以上により,Server01からServer02へのpingが通るようになりました.ご確認のほどよろしくお願いいたします.

トラブル2

Server01 と Server02 との間の時刻に差異が生じていたため,DNSSECの署名の検証を失敗し名前解決が出来ていませんでした.

実際に Server01 と Sever02 の時刻は以下の通りになっています.

user@Server01:~$ date
Sat Nov  9 05:07:53 AM JST 2024
user@Server01:~$ journalctl -r
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
Nov 09 05:07:24 Server01 sudo[12088]: pam_unix(sudo:session): session closed for user root
Nov 09 05:04:44 Server01 sudo[12088]: pam_unix(sudo:session): session opened for user root(uid=0) by user(uid=1002)

このため,Server01 と Server02 の時刻を揃えることで,署名の検証を可能にします.

以下のコマンドで時刻を揃えました.

user@Server01:~$ sudo systemctl enable --now chrony.service
Synchronizing state of chrony.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable chrony
Created symlink /etc/systemd/system/chronyd.service → /usr/lib/systemd/system/chrony.service.
Created symlink /etc/systemd/system/multi-user.target.wants/chrony.service → /usr/lib/systemd/system/chrony.service.

この同期に時間がかかるため,少し待機をすると疎通出来ることを確認しました.

user@Server01:~$ dig @127.0.0.1 ictsc2024-2.internal

; <<>> DiG 9.18.28-0ubuntu0.24.04.1-Ubuntu <<>> @127.0.0.1 ictsc2024-2.internal
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28360
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;ictsc2024-2.internal.          IN      A

;; ANSWER SECTION:
ictsc2024-2.internal.   30      IN      A       192.168.2.1

;; Query time: 4 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Sat Dec 07 17:41:22 JST 2024
;; MSG SIZE  rcvd: 65