netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Kernel Routing tabel
@ 2021-03-11  9:06 Mihai
  0 siblings, 0 replies; only message in thread
From: Mihai @ 2021-03-11  9:06 UTC (permalink / raw)
  To: netdev

Hello,

I have 2 NIC with ips
eth1: 10.100.1.2/30
eth2: 10.200.1.2/30
both of them must reach IP: 172.16.16.1

what i've done so far:
eth1:
ip route add 10.100.1.0/30 dev eth1 src 10.100.1.2 scope link table 100
ip route add default via 10.100.1.1 dev eth1 table 100
ip rule add from 10.100.1.0/30 dev eth1 table 100
ip rule add to 10.100.1.0/30 dev eth1 table 100
ip rule add to 172.16.16.1 lookup 100

eth2:
ip route add 10.200.1.0/30 dev eth1 src 10.200.1.2 scope link table 200
ip route add default via 10.200.1.1 dev eth2 table 200
ip rule add from 10.200.1.0/30 dev eth2 table 200
ip rule add to 10.200.1.0/30 dev eth2 table 200
ip rule add to 172.16.16.1 lookup 200

It kinda works if I ping with source interface, but i have the problem:
 - that the packet goes on the interface with the lowest priority
between eth1 and eth2.

How can I make it work so that when the packet originates from eth1 it
goes through eth1 and so on.?

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-11  9:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11  9:06 Kernel Routing tabel Mihai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).