宛先ホストに到達できません: フェイルオーバー IP アドレス

宛先ホストに到達できません: フェイルオーバー IP アドレス

このガイドに従って、2 つの IP アドレスを追加しました。https://docs.ovh.com/ie/en/dedicated/network-ipaliasing/#debian-9-ubuntu-1704-and-arch-linux_1

cat /etc/systemd/network/50-default.network

[Match]
MACAddress=08:(...)

[Network]
Description=network interface on public network, with default route
DHCP=no
Address=37.187.90.XX/24
Gateway=37.187.90.254
IPv6AcceptRA=no
NTP=ntp.ovh.net
DNS=127.0.0.1
DNS=213.186.33.99
DNS=2001:41(...)
Gateway=2001:41(...)

[Address]
Address=2001:41d(...)

[Address]
Address=188.165.20.XXX
Label=failover1

[Address]
Address=94.23.157.XXX
Label=failover2

[Route]
Destination=2001:41(...)
Scope=link

すべて正常に動作していますが、pingができません94.152.8.40(異なる ISP からの外部サーバー)

ping -c 4 94.152.8.40

PING 94.152.8.40 (94.152.8.40) 56(84) bytes of data.
From 94.23.157.XXX icmp_seq=1 Destination Host Unreachable
From 94.23.157.XXX icmp_seq=2 Destination Host Unreachable
From 94.23.157.XXX icmp_seq=3 Destination Host Unreachable
From 94.23.157.XXX icmp_seq=4 Destination Host Unreachable
(...)

-I を使用して 94.152.8.40 に ping を実行できます。

ping -c4 -I 37.187.90.XX 94.152.8.40

PING 94.152.8.40 (94.152.8.40) from 37.187.90.XXX : 56(84) bytes of data.
64 bytes from 94.152.8.40: icmp_seq=1 ttl=52 time=32.6 ms
64 bytes from 94.152.8.40: icmp_seq=2 ttl=52 time=32.0 ms
64 bytes from 94.152.8.40: icmp_seq=3 ttl=52 time=32.0 ms
64 bytes from 94.152.8.40: icmp_seq=4 ttl=52 time=32.0 ms
(...)

ip route show to match 94.152.8.40

default via 37.187.90.254 dev enp3s0 proto static 
94.0.0.0/8 dev enp3s0 proto kernel scope link src 94.23.157.XXX

netstat -nr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         37.187.90.254   0.0.0.0         UG        0 0          0 enp3s0
37.187.90.0     0.0.0.0         255.255.255.0   U         0 0          0 enp3s0
94.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 enp3s0
188.165.0.0     0.0.0.0         255.255.0.0     U         0 0          0 enp3s0

ip route list

default via 37.187.90.254 dev enp3s0 proto static 
37.187.90.0/24 dev enp3s0 proto kernel scope link src 37.187.90.XX 
94.0.0.0/8 dev enp3s0 proto kernel scope link src 94.23.157.XXX 
188.165.0.0/16 dev enp3s0 proto kernel scope link src 188.165.20.XXX 

94.23.157.XXXを無効にすると/etc/systemd/network/50-default.network

   #[Address]
   #Address=94.23.157.XXX
   #Label=failover2

再起動するとsystemctl restart systemd-networkd、94.152.8.40 に問題なく ping できるようになりました。

ping -c 4 94.152.8.40

PING 94.152.8.40 (94.152.8.40) 56(84) bytes of data.
64 bytes from 94.152.8.40: icmp_seq=1 ttl=52 time=32.0 ms
64 bytes from 94.152.8.40: icmp_seq=2 ttl=52 time=32.0 ms
64 bytes from 94.152.8.40: icmp_seq=3 ttl=52 time=32.0 ms
64 bytes from 94.152.8.40: icmp_seq=4 ttl=52 time=32.1 ms

netstat -nr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         37.187.90.254   0.0.0.0         UG        0 0          0 enp3s0
37.187.90.0     0.0.0.0         255.255.255.0   U         0 0          0 enp3s0

ip route list

default via 37.187.90.254 dev enp3s0 proto static 
37.187.90.0/24 dev enp3s0 proto kernel scope link src 37.187.90.XX 

ip route show to match 94.152.8.40

default via 37.187.90.254 dev enp3s0 proto static 

両方のルートを無効にする方法

94.0.0.0/8 dev enp3s0 proto kernel scope link src 94.23.157.XXX 
188.165.0.0/16 dev enp3s0 proto kernel scope link src 188.165.20.XXX 

追加のIP(フェイルオーバー)を無効にせず、すべての宛先にデフォルトの37.187.90.0/24ゲートウェイを1つだけ使用する

ありがとう、ダビド

関連情報