Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am having an issue with a CentOS 6.3 box. We have two NICs (eth0 and eth1) in the server which each have an ip from a different subnet assigned, let's say eth0: (gateway and eth1: (gateway The real ips are world routable though.

Each NIC is connected to a different switch but ends up on one router in the end. On the router these two subnets are in different VLANs, the ports to the NICs are untagged so no vlan id is passed onto the server.

Now on FreeBSD I just assign the ips to each NIC and it just works, both IPs are reachable. On CentOS I can only reach the IP of which the gateway is active as the default route. I can ping the IP anything within the same VLAN/subnet but outside that it is unreachable.

When I do a traceroute to each of the gateways i see they go over the appropriate NIC, makes sense as the gatewaty is inside the scope. However outside the subnet I can only ping currently.

IPtables is not active at the moment either.

What would be the required action to get this to work?

I googled around for hours, tried different approaches but it won't work. I have the feeling I am missing something important, hopefully an easy fix :-)

Any help is appreciated Thanks ! Scott


# route -n  
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0   U     0      0        0 eth1     U     1002   0        0 eth0     U     1003   0        0 eth1         UG    0      0        0 eth0


# ip addr list
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:16:70:c7 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
    inet6 fe80::baac:6fff:fe16:70c7/64 scope link 
       valid_lft forever preferred_lft forever

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether b8:ac:6f:16:70:c9 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth1
    inet6 fe80::baac:6fff:fe16:70c9/64 scope link 
       valid_lft forever preferred_lft forever
share|improve this question
Good first question! –  slm Dec 23 '12 at 4:28

1 Answer 1

up vote 7 down vote accepted

You need to create a multipath route or active a dynamic routing protocol (ospf, isis).

Mulitpath example:

ip route del default via dev eth0
ip route add default scope global nexthop via dev eth0 weight 1 \
        nexthop via dev eth1 weight 1
share|improve this answer
Wow kudos to you, that works Thanks a lot rhasti! –  Scott Dec 23 '12 at 5:08
If someone ends up here googling; adding it to /etc/rc.d/rc.local makes it permanent –  Scott Dec 23 '12 at 5:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.