Article 5D11M ip routes and rules

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!latest?d=yIl2AUoC8zA latest?i=TZPYGgpjZZM:TgVEToLKyJA:F7zBnMy latest?i=TZPYGgpjZZM:TgVEToLKyJA:V_sGLiP latest?d=qj6IDK7rITs latest?i=TZPYGgpjZZM:TgVEToLKyJA:gIN9vFwTZPYGgpjZZM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments