On Sun, Dec 15, 2019 at 08:57:48PM +0100, Denis Fondras wrote:
> Hi,
> 
> I have this setup :
> 
> em3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         lladdr 
>         index 4 priority 0 llprio 3
>         media: Ethernet autoselect (1000baseSX full-duplex)
>         status: active
>         inet6 fe80::aa9:b803:8a7a:ca72%em3 prefixlen 64 scopeid 0x4
>         inet 172.16.0.254 netmask 0xffffff00 broadcast 172.16.0.255
> em4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         lladdr
>         index 5 priority 0 llprio 3
>         media: Ethernet autoselect (1000baseSX full-duplex)
>         status: active
>         inet 172.16.0.249 netmask 0xfffffffc broadcast 172.16.0.251
>         inet6 fe80::29ae:98d:f238:fd68%em4 prefixlen 64 scopeid 0x5
> 
> I have a computer with IPv4 address 172.16.0.248 connected to em3.
> When I try to ping it, obviously it goes to em4.
> 
> How can I route 172.16.0.248 through em3 ?
> 
> I tried with :
> * route add 172.16.0.248/32 172.16.0.254 -iface em3
> * route add 172.16.0.248/32 -llinfo -link -static -iface em3
> but without luck.
> 

You have overlapping networks and you try to add an IP from the more
specific into the less specific block. That is going to be tricky and it
will most probably not work in all cases (e.g. hosts on the more specific
network would not be able to talk to that IP).

While it may be possible to coerce the routing table into doing the right
thing it will probably not work well.
One way to work around this is using rdomains another is renumbering the
network.

-- 
:wq Claudio

Reply via email to