0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PIngは通るのにSSH22が通らない。OSPF ECMP 非対称ルーティング

0
Posted at

image.png

Ansible端末からFRR-CoreへSSHが通らない。

Edge側でtcpdump

#tcpdump port 22#なにも捉えない
tcpdump -i any -nn port 22
#---...
# edge1
12:18:16.749359 eth1  In  IP 192.168.254.15.38416 > 192.168.32.3.22: Flags [S], seq 1913503340, win 64240, options [mss 1460,sackOK,TS val 3670050476 ecr 0,nop,wscale 10], length 0
12:18:16.749370 eth4  Out IP 192.168.254.15.38416 > 192.168.32.3.22: Flags [S], seq 1913503340, win 64240, options [mss 1460,sackOK,TS val 3670050476 ecr 0,nop,wscale 10], length 0

#edge2
12:18:16.749337 eth4  In  IP 192.168.32.3.22 > 192.168.254.15.38416: Flags [S.], seq 903009347, ack 1913503341, win 65160, options [mss 1460,sackOK,TS val 3053239594 ecr 3670014542,nop,wscale 10], length 0
12:18:16.749390 eth4  In  IP 192.168.32.3.22 > 192.168.254.15.38416: Flags [S.], seq 903009347, ack 1913503341, win 65160, options [mss 1460,sackOK,TS val 3053239594 ecr 3670014542,nop,wscale 10], length 0

一目で非対称ルーティングだと直感的に感じる。実際そうか。

tcpdump -i any -nn host 192.168.32.3
#---
# core
# 届いていなかった。

LinuxカーネルのECMPハッシュアルゴリズムを変更してみる。

sysctl net.ipv4.fib_multipath_hash_policy
#---
net.ipv4.fib_multipath_hash_policy = 0
#0 L3
#1 L4
#L3+Flow label IPv6向け

L4に変更する
接続先がもし接続元に対してのパスが複数ある場合、接続先も。
中継するOSPF ECMPルータは必ず有効にする。

sudo sysctl -w net.ipv4.fib_multipath_hash_policy=1

nftablesの設定変更は不要
永続化させる

echo "net.ipv4.fib_multipath_hash_policy = 1" | sudo tee /etc/sysctl.d/60-ecmp-hash.conf
# 設定反映
sudo sysctl -p /etc/sysctl.d/60-ecmp-hash.conf
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?