I have ubuntu 20.04 server with 2 interfaces / eth0:94.101.177.244 eth1:94.101.176.149
Eth0 is work well and When i ping from server to out with eth1, it success.
But when i ping from pc eth1, it fails.
~$ ip route show
default via 94.101.176.1 dev eth0 proto dhcp src 94.101.177.244 metric 100
default via 94.101.176.1 dev eth1 proto dhcp src 94.101.176.149 metric 100
94.101.176.0/22 dev eth0 proto kernel scope link src 94.101.177.244
94.101.176.0/22 dev eth1 proto kernel scope link src 94.101.176.149
169.254.169.254 via 94.101.176.10 dev eth0 proto dhcp src 94.101.177.244 metric 100
169.254.169.254 via 94.101.176.10 dev eth1 proto dhcp src 94.101.176.149 metric 100
~$ cat /etc/iproute2/rt_tables
#
# reserved values
#
255 local
254 main
253 default
0 unspec
#1 inr.ruhep
~$ ip rule show
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
#from pc
ping 94.101.177.149
Pinging 94.101.177.149 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 94.101.177.149:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
#from server
~$ ping google.com -I eth1
PING google.com (216.239.38.120) from 94.101.176.149 eth1: 56(84) bytes of data.
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=1 ttl=107 time=27.8 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=2 ttl=107 time=26.0 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=3 ttl=107 time=25.5 ms
64 bytes from any-in-2678.1e100.net (216.239.38.120): icmp_seq=4 ttl=107 time=25.6 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 25.480/26.217/27.783/0.924 ms
I know problem here are creating route table for each interface, but i don't know how do it...