1

If I have two interfaces (eth0 and eth1) on separate VLANs (100 and 200), can they be bonded together into bond0 in such a way that traffic for each VLAN can be routed correctly?

Let’s say the subnet 10.1.1.0/24 is on VLAN 100 and subnet 10.1.2.0/24 is on VLAN 200 and the gateways are 10.1.1.1 and 10.1.2.1, respectively.

  • Server 1: Has eth0 (VLAN100) and eth1 (VLAN200). eth0 has IP 10.1.1.2, and eth1 has IP 10.1.2.2.
  • Server 2: Has eth0 (VLAN100) and eth1 (VLAN200). eth0 has IP 10.1.1.3, and eth1 has no IP.

Can eth0 and eth1 on server 1 be bonded into bond0 such that traffic for the 10.1.1.0/24 subnet will flow through eth0, and for 10.1.2.0/24 will flow through eth1?

Can eth0 and eth1 in server 2 be bonded into bond0 such that it can reach IPs in the 10.1.2.0/24 subnet, even though it doesn't have an IP in that subnet/VLAN?

Giacomo1968
  • 58,727

1 Answers1

3

Can eth0 and eth1 on server 1 be bonded into bond0 such that traffic for the 10.1.1.0/24 subnet will flow through eth0, and for 10.1.2.0/24 will flow through eth1?

No, the whole point of bonding is to make both ports act as a single, unified connection (usually to multiply the available bandwidth). If your interfaces must remain on different VLANs and on different IP subnets, then bonding is the completely wrong tool.

To keep the interfaces separate, you just keep them separate, that's all.


Can eth0 and eth1 in server 2 be bonded into bond0 such that it can reach IPs in the 10.1.2.0/24 subnet, even though it doesn't have an IP in that subnet/VLAN?

As already mentioned above, that's not what "bonding" does.

The server can be configured to reach the 10.1.2.0/24 subnet, but if it's not directly connected to that subnet, then it uses a router to do so. What you're asking for is just regular IP routing between networks.

If both subnets share the same gateway, then all neccessary routes should already be present. Just make sure the router's firewall is not configured to block such connections.

If each subnet uses a different device as its gateway, then add static routes on each gateway pointing to the opposite subnet.

Finally, VLAN membership without an IP address is useless. (Same as with physical networks.) If you want a server to be directly connected to multiple networks, then every interface needs an IP address. If you want the server to only have one IP address, then don't create the extra VLAN interfaces at all.

grawity
  • 501,077