Re: route an IPv4 /32 to a different interface

2019-12-16 Thread Claudio Jeker
On Sun, Dec 15, 2019 at 08:57:48PM +0100, Denis Fondras wrote:
> Hi,
> 
> I have this setup :
> 
> em3: flags=8843 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 0xff00 broadcast 172.16.0.255
> em4: flags=8843 mtu 1500
> lladdr
> index 5 priority 0 llprio 3
> media: Ethernet autoselect (1000baseSX full-duplex)
> status: active
> inet 172.16.0.249 netmask 0xfffc 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



Re: route an IPv4 /32 to a different interface

2019-12-16 Thread Denis Fondras
On Sun, Dec 15, 2019 at 08:29:42PM +, Tom Smyth wrote:
> Hi Denis,
> 
> ok ..I hadnt read your email fully sorry about that...
> 
> what are you trying to achieve here?
> 
> you have a  172.16.0.249/30 address on em3  which includes
> 172.16.0.248-127.16.0.251
> 
> and then you have a 172.16.0.254/24 which includes the entire range of
>  172.16.0.0-172.16.0.255
> 
> I think you are making life tougher on your self and who ever has to
> diagnose the system after you...
> it is private IP space co can you not put them on different networks
> and do meat and Potatoes Routing ?
> 
> the other thing you need to consider is that you need to turn on proxy
> arp (which can be very counter productive and cause other issues  ) so
> that your host responds to arp requests for
> 
> 172.16.0.249 and 172.16.0.250  on em3 (assuming you want hosts on the
> network attached to em3 to be able to talk the ips connected to em4)
> 
> the other concern I would have is that you are trying to route traffic
> to an ip that is a reserved ip  172.16.0.248 is the network address of
> em4 according to your configuration...
> 
> I hope this helps...
> 

Thank you, I will try to renumber, this sounds like the best idea :)



Re: route an IPv4 /32 to a different interface

2019-12-15 Thread Kapetanakis Giannis

On 15/12/2019 21:57, Denis Fondras wrote:

Hi,

I have this setup :

em3: flags=8843 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 0xff00 broadcast 172.16.0.255
em4: flags=8843 mtu 1500
 lladdr
 index 5 priority 0 llprio 3
 media: Ethernet autoselect (1000baseSX full-duplex)
 status: active
 inet 172.16.0.249 netmask 0xfffc 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.

Thank you in advance,
Denis




You can do this with pf route-to

G



Re: route an IPv4 /32 to a different interface

2019-12-15 Thread Tom Smyth
Hi Denis,

ok ..I hadnt read your email fully sorry about that...

what are you trying to achieve here?

you have a  172.16.0.249/30 address on em3  which includes
172.16.0.248-127.16.0.251

and then you have a 172.16.0.254/24 which includes the entire range of
 172.16.0.0-172.16.0.255

I think you are making life tougher on your self and who ever has to
diagnose the system after you...
it is private IP space co can you not put them on different networks
and do meat and Potatoes Routing ?

the other thing you need to consider is that you need to turn on proxy
arp (which can be very counter productive and cause other issues  ) so
that your host responds to arp requests for

172.16.0.249 and 172.16.0.250  on em3 (assuming you want hosts on the
network attached to em3 to be able to talk the ips connected to em4)

the other concern I would have is that you are trying to route traffic
to an ip that is a reserved ip  172.16.0.248 is the network address of
em4 according to your configuration...

I hope this helps...




On Sun, 15 Dec 2019 at 20:11, Denis Fondras  wrote:
>
> Hi,
>
> I have this setup :
>
> em3: flags=8843 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 0xff00 broadcast 172.16.0.255
> em4: flags=8843 mtu 1500
> lladdr
> index 5 priority 0 llprio 3
> media: Ethernet autoselect (1000baseSX full-duplex)
> status: active
> inet 172.16.0.249 netmask 0xfffc 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.
>
> Thank you in advance,
> Denis
>


-- 
Kindest regards,
Tom Smyth.



Re: route an IPv4 /32 to a different interface

2019-12-15 Thread Tom Smyth
Hi Denis
Try to add a static arp entry   for that particular Ip 172.16.0.248/32
 to the mac address of 172.16.0.254
that should work

On Sun, 15 Dec 2019 at 20:11, Denis Fondras  wrote:
>
> Hi,
>
> I have this setup :
>
> em3: flags=8843 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 0xff00 broadcast 172.16.0.255
> em4: flags=8843 mtu 1500
> lladdr
> index 5 priority 0 llprio 3
> media: Ethernet autoselect (1000baseSX full-duplex)
> status: active
> inet 172.16.0.249 netmask 0xfffc 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.
>
> Thank you in advance,
> Denis
>


-- 
Kindest regards,
Tom Smyth.



route an IPv4 /32 to a different interface

2019-12-15 Thread Denis Fondras
Hi,

I have this setup :

em3: flags=8843 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 0xff00 broadcast 172.16.0.255
em4: flags=8843 mtu 1500
lladdr
index 5 priority 0 llprio 3
media: Ethernet autoselect (1000baseSX full-duplex)
status: active
inet 172.16.0.249 netmask 0xfffc 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.

Thank you in advance,
Denis