In my server, I have two ethernet cards:
enp0s17
, local IP192.168.0.7
, router's public addressx.x.x.x
, netmask255.255.255.255
enp0s18
, local IP172.16.0.7
, router's public addressy.y.y.y
, netmask255.255.255.0
On both networks, any incoming traffic of the two public IPs is routed to the server. So, actually any SSH, HTTP etc. going to x.x.x.x
should be forwarded to 192.168.0.7
and any traffic to y.y.y.y
should be forwarded to 172.16.0.7
.
Unfortunately, this is only working for one of them at once. Sometimes (after dis- and reconnecting the server to internet e.g. after reboot) this works for enp0s17
and sometimes for enp0s18
but never for both at the same time. (So, both routers are routing properly, seems to be an issue of the server.)
Same issue applies for outgoing traffic tested with curl --interface enp0s1X ...
.
On the other hand, any local traffic is routing properly. In both networks, the server is always available on it's local IPs.
Does anyone have an idea what might cause this issue or how to solve it?
For testing purpose I completely disabled the firewall, so, this shouldn't be the problem.
(Both interfaces are using IPv6 prefix delegation too but I just left it out as it's working properly.)
Both routers are Ubiquiti EdgeRouters. IPs are statically given by the DHCP servers on the routers. Network configuration is done using netplan
. Using Ubuntu 20.04.
My netplan
config:
network:
version: 2
renderer: networkd
ethernets:
enp0s17:
dhcp4: yes
dhcp6: yes
enp0s18:
dhcp4: yes
dhcp6: yes
default route:
default via 192.168.0.1 dev enp0s17 proto dhcp src 192.168.0.7 metric 100
default via 172.16.0.1 dev enp0s18 proto dhcp src 172.16.0.7 metric 100
172.16.0.0/16 dev enp0s18 proto kernel scope link src 172.16.0.7
172.16.0.1 dev enp0s18 proto dhcp scope link src 172.16.0.7 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
172.18.0.0/16 dev br-b20299b5e473 proto kernel scope link src 172.18.0.1
172.19.0.0/16 dev br-ba582f6855c2 proto kernel scope link src 172.19.0.1
192.168.0.0/24 dev enp0s17 proto kernel scope link src 192.168.0.7
192.168.0.1 dev enp0s17 proto dhcp scope link src 192.168.0.7 metric 100