On 08/09/2016 12:03 PM, John R Pierce wrote:> those are both the same network, and the default gateway is a global > thing. packets forwarded to 192.168.1.1 could use either 192.168.1.12 > or .13, as they are all the same. in reality, they will use the first > match they find.Generally, but not necessarily. What Birta is trying to accomplish is called "multi-homing." The oracle document I linked to is one of the shortest, accurate descriptions of its configuration on Red Hat derived systems that I've come across.
On 09/08/2016 23:11, Gordon Messmer wrote:> On 08/09/2016 12:03 PM, John R Pierce wrote: >> those are both the same network, and the default gateway is a global >> thing. packets forwarded to 192.168.1.1 could use either 192.168.1.12 >> or .13, as they are all the same. in reality, they will use the first >> match they find. > > > Generally, but not necessarily. What Birta is trying to accomplish is > called "multi-homing." The oracle document I linked to is one of the > shortest, accurate descriptions of its configuration on Red Hat derived > systems that I've come across.I read the document again ... and this talk about accessing this multi-homed host from the internet... I have all this configured and working! My problem is when a connection is initiated on this multi-homed or whatever host ... and the difference is that in my case the gateway is the same for both interfaces And as I said this problem is resolved too ... I asked for another way to achieve this -- Levi
On Wed, Aug 10, 2016 at 09:29:15AM +0300, Levente Birta wrote:> I read the document again ... and this talk about accessing this multi-homed > host from the internet... > I have all this configured and working!You say this is working because of the output here? # ip route show default via 192.168.1.1 dev enp3s0 default via 192.168.1.1 dev enp2s0 169.254.0.0/16 dev enp2s0 scope link metric 1002 169.254.0.0/16 dev enp3s0 scope link metric 1003 192.168.1.0/24 dev enp2s0 proto kernel scope link src 192.168.1.12 192.168.1.0/24 dev enp3s0 proto kernel scope link src 192.168.1.13 -- Jonathan Billings <billings at negate.org>
On 10/08/16 16:29, Levente Birta wrote:> And as I said this problem is resolved too ... I asked for another way > to achieve thisWhen you add a default gateway with: route add default gw 192.168.1.1 dev enp3s0 you'll note that you now have 2 routes with the same metric of 0 (use route -n to see the metric field - couldn't get ip route to show me the metric). When using ip route command, you need to specify a different metric otherwise it won't take. To me, ip route is doing the right thing as having 2 gateways with the same metric will confuse the routing process. If you need to use ip route to add another default gateway, make sure to use a different metric: ip route add 0/0 via 192.168.1.1 dev enp3s0 metric <different_from_other_one> ak. ------------------------------------ PS: In my virtual environment *[0]*, the routing tables for tables t2 and t3 appeared incomplete. The route specified in the route files for network 192.168.1.0/24 was missing - most likely cause it was already in the main routing table. Only the default route appeared in the tables $ cat /etc/sysconfig/network-scripts/route-enp0s3 192.168.1.0/24 dev enp0s3 src 192.168.1.12 table t2 default via 192.168.1.1 dev enp0s3 table t2 $ cat /etc/sysconfig/network-scripts/route-enp0s8 192.168.1.0/24 dev enp0s8 src 192.168.1.13 table t3 default via 192.168.1.1 dev enp0s8 table t3 $ ip r l t t2 default via 192.168.1.1 dev enp0s3 $ ip r l t t3 default via 192.168.1.1 dev enp0s8 *[0]* - https://imagebin.ca/v/2r5NJgNEqSgQ