【メモ】VyOSのBeta版(999-xxx) とCiscoのGREについて

CiscoのGRE Tunnel設定にはkeepalive設定がある。ステートレスなGREだけどこれのおかげでCiscoルータではGREの状態を管理できる。

VyOSとよくGRE over IPSecの設定をやるが, このKeepaliveパケットが1.1.7では機能していたのだが, 今出ているBeta版では「martian source ・・・」とメッセージが出て折り返しパケットが破棄される。

なお, VyOSはGREのKeepaliveは対応していないが, CiscoのKeepaliveの仕組みは対向の機器が対応していなくても機能する仕組みとなっている。
参考) CiscoのGRE Keepalive メカニズム
実際, VyOSの1.1.7ではCisco側で設定しても問題ない。

とはいえ, Beta版のVyOSとCiscoルータでGREトンネルをはるときは, Keep Aliveは設定できないので注意が必要です。

パケットフォーマットを見るとたしかに気持ち悪いっちゃー気持ち悪いんだけど, 今の1.1.7で正常に通信できるんだから, 早いとこ対応してほしいのが本音。

【メモ】OSPFにおけるdistribute-listの扱い

今更だけどOSPFでは経路制御は同一エリア内だと受信側で拒否するしかできないのね。
送信でフィルタは掛けられない, 途中のルータで受信拒否してもLSAでアドバタイズされるからその先には伝搬してしまう。このあたり理解できていなかった。

エリアを分けるかプロトコル分けるかなどして再配信じゃないと細かい制御ってできないのね。

簡単な構成で確認した。
R1とR3は普通にOSPFで配信。R2でdistribute-listで192.168系のルートを受信拒否。
R2で拒否すればその先へもルート情報は流れないだろうなーなんて安易に思っていました。OSPFとdistribute-listのこと理解できていませんでした。さーせん。

ルータ3台でOSPFでルーティングさせる

・R1のConfig

interface FastEthernet0/0
ip address 172.16.10.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.10.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.20.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 172.16.10.0 0.0.0.255 area 10
network 192.168.10.0 0.0.0.255 area 10
network 192.168.20.0 0.0.0.255 area 10
!

・R2のConfig

interface FastEthernet0/0
ip address 172.16.10.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.16.20.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 172.16.0.0 0.0.255.255 area 10
distribute-list Deny_OSPF in
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
ip access-list standard Deny_OSPF
deny 192.168.0.0 0.0.255.255
permit any

・R3のConfig

interface FastEthernet0/0
ip address 172.16.20.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.30.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 192.168.40.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
network 172.16.20.0 0.0.0.255 area 10
network 192.168.30.0 0.0.0.255 area 10
network 192.168.40.0 0.0.0.255 area 10

それぞれのルーティングテーブルを見ると

R1#sh ip route 
Codes: 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

Gateway of last resort is not set

O 192.168.30.0/24 [110/30] via 172.16.10.2, 00:10:34, FastEthernet0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/1
O 192.168.40.0/24 [110/21] via 172.16.10.2, 00:10:34, FastEthernet0/0
172.16.0.0/24 is subnetted, 2 subnets
O 172.16.20.0 [110/20] via 172.16.10.2, 00:13:10, FastEthernet0/0
C 172.16.10.0 is directly connected, FastEthernet0/0
C 192.168.20.0/24 is directly connected, FastEthernet1/0
R2#sh ip route 
Codes: 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

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 2 subnets
C 172.16.20.0 is directly connected, FastEthernet0/1
C 172.16.10.0 is directly connected, FastEthernet0/0
R3#sh ip route 
Codes: 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

Gateway of last resort is not set

C 192.168.30.0/24 is directly connected, FastEthernet0/1
O 192.168.10.0/24 [110/30] via 172.16.20.1, 00:11:22, FastEthernet0/0
C 192.168.40.0/24 is directly connected, FastEthernet1/0
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.20.0 is directly connected, FastEthernet0/0
O 172.16.10.0 [110/20] via 172.16.20.1, 00:11:22, FastEthernet0/0
O 192.168.20.0/24 [110/21] via 172.16.20.1, 00:11:22, FastEthernet0/0

R2だけがルーティングテーブルに192.168系が載っていない。

設計時に経路制御とかしっかり盛り込んでおかないとあとから「やべっ!できねーじゃん」ってなるね。