On 09/08/2016 15:47, Jonathan Billings wrote:
On Tue, Aug 09, 2016 at 10:58:40AM +0300, Levente Birta wrote:
What I don't understand why the route command allow to add a second default gateway with different interface, but the ip route command doesn't?
You can only have one default gateway.
It sounds to me like you want to use both interfaces, which are both on the same subnet and would connect to the same gateway, as some sort of load-balanced network, where traffic is evenly distributed across both interfaces? Or did I mis-read your initial question?
No, there is no load-balancing.... It is a server on the LAN with two NICs, two IPs and I want to access the internet on both interfaces ... which means, practically, different WAN connection, but from the server's point of view doesn't matter, the routing to different WAN is a job of gateway's. And as I said in the initial message I achieved this ... :) The question is how can I achieve this with more elegant way, because the "route" command is deprecated anyway.
So, again: Centos 7 2 NICs enp2s0-192.168.1.12 enp3s0-192.168.1.13 default gateway on enp2s0 is 192.168.1.1, defined in /etc/sysconfig/network
Which other way (preferred with "ip route") can I add this, but: #route add default gw 192.168.1.1 dev enp3s0 ????
Thanks Levi