I've got a linux d/b server (OEL 6.4 but effectively Redhat 6 I believe) with bonded nics connecting to juniper switches.

I've split the bond up into multiple vlans (bond0.11, ... bond0.18) with IP address ranges 192.168.X.Y/22 so that the d/b server instances can listen on those addresses separately, and thus ensure d/b access is done by appropriate VLAN membership and projects on different vlans can't connect to each others databases without explicit rules on the Juniper firewall.

When I bring the network up I have 2 issues:

  1. The g/w is set to on every bond's network
  2. I have to manually add routes to the correct g/w for each network

So for instance, I have the following routing by default:

Destination  GateWay  Genmask        ... Iface      bond0.11      bond0.12
... etc

And I have to manually add the routes to the gateways for each network with

route add -net netmask gw
route add -net netmask gw

What I'd like to do is have this automatically set the X.1 gateway addresses when the network starts, but I haven't been able to find the appropriate magic to enable this.

I've tried adding files for route-bond0.11 with: via

but when I start the network, I get an error

Bringing up interface bond0:                           [ OK ]
Bringing up interface bond0.11: RTNETWORK answers: File exists

which I've looked up and usually means the route isn't required as it already exists. Presumably this is because of the default entries I'm getting.

I don't have a GATEWAY entry in any of the ifcfg-bond0.XX files (tried that and the "last one" wins setting the global default gateway which isn't what I want in this case anyway).

So my questions are:

  • How do I get the network to come up without the entries?
  • Would this then enable the route-bond.XX files to work correctly?
  • Or is there another way to get the routes to be defined on startup of the network?

Once my manual routes are in place everything is fine, the gateways on the juniper are all there and traffic flows across my VLANs as expected, I just can't get the initial settings to be what happen on boot-up or restart of the network.

EDIT Rather embarrassingly after rebooting everything it all is working as should be, and doesn't need the routing added to get traffic to work to the rest of the VLAN through the switch. This was a mixture of a transient problem with the new setup and my understanding of gateways in this case it seems.

1 Answer 1


you seem to read the information in the routing table wrong.

Destination  GateWay  Genmask        ... Iface      bond0.11      bond0.12

The above actually means that network is locally connected on bond0.11, thus can be reached without a gateway.
A gateway entry would look like:

Destination  GateWay      Genmask            ... Iface      bond0.11

However you do not need this to send traffic to a locally connected network.

So from what I see there isn't really something wrong with your interface setup, and normally after a reboot your clients of vlan x should be able to connect to the server IP on vlan x.

  • Your second version is what it looks like after I put my manual routing in (although the entry is still there). just checking, it appears to be working today... Dec 3, 2014 at 12:41
  • Well this is all rather embarrassing. After rebooting everything, I don't need to add the routes for the traffic to work, but I swear I did yesterday. Also, I think I understand better what you're saying, a gateway is only needed for traffic off the local subnet ( in this case), and that traffic on this subnet will transparently work through the switch without me having to give it the gateway's IP address. Dec 3, 2014 at 13:15
  • sometimes a reboot / restart of the networking is needed to flush the routing tables etc. I have encountered it before. And indeed. A gateway is only needed when you want to reach a destination outside of the locally connected LAN.
    – Goez
    Dec 3, 2014 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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