대상 호스트에 연결할 수 없음: 장애 조치 IP 주소

대상 호스트에 연결할 수 없음: 장애 조치 IP 주소

이 가이드에 따라 두 개의 추가 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

모든 것이 잘 작동하지만 핑을 할 수 없습니다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(FailOver)를 비활성화하지 않고 모든 대상에 대해 기본 37.187.90.0/24 게이트웨이 하나만 사용하면 됩니다.

고마워요, 데이빗

관련 정보