ip routes and rules
by goodiemobster from LinuxQuestions.org on (#5D11M)
Hi!
Lets say I have a VM-testserver with an internal ip 192.168.13.x with only 1 NIC (ens160)
Then I have a VM-server which has a public IP (1.2.3.4 and nic ens160) and also an extra NIC (ens192) with an 192.168.13.0/24 range IP.
I can't ping the public domain from the testserver unless I add these routes/rules on the public server:
ip route add 1.2.3.0/24 dev ens160 src 1.2.3.4 table route1
ip route add default via 1.2.3.1 dev ens160 table route1
ip rule add from 1.2.3.4/24 table route1
ip rule add to 1.2.3.4/24 table route1
I get ping replies from the 3rd command.
I don't understand why this works all of a sudden? I don't define rules for the 192.168.13.x traffic ?
I'm pretty new to networking so if it was a stupid question, you can rub it in!
tnx in advance!


Lets say I have a VM-testserver with an internal ip 192.168.13.x with only 1 NIC (ens160)
Then I have a VM-server which has a public IP (1.2.3.4 and nic ens160) and also an extra NIC (ens192) with an 192.168.13.0/24 range IP.
I can't ping the public domain from the testserver unless I add these routes/rules on the public server:
ip route add 1.2.3.0/24 dev ens160 src 1.2.3.4 table route1
ip route add default via 1.2.3.1 dev ens160 table route1
ip rule add from 1.2.3.4/24 table route1
ip rule add to 1.2.3.4/24 table route1
I get ping replies from the 3rd command.
I don't understand why this works all of a sudden? I don't define rules for the 192.168.13.x traffic ?
I'm pretty new to networking so if it was a stupid question, you can rub it in!
tnx in advance!