network trunking is not working properly
HI
i installed REHL6.1. network port is connected to eth0 interface. trunking is enabled on the switch level
i loaded the kernel modules. and created three virtual network adapter eth0.21 , eth0.3 and eth0.8
we need to configure three different network with different gateways. after giving gateway entry on these three files, we restarted network. then only one gateway is showing (route -n). that particular network is pining from outside machine.But we need to ping other 2 ip's from outside machine.
how can i solve this issue. please check attached network output


Regards,
Ben
Responses
It's not possible to have multiple default gateways in the one routing table. What you're looking to configure is called "source routing", where you create one routing table per interface, and route traffic based on rules.
The following knowledgebase articles describe the setup you're after:
How can I route network traffic such that the packets go out via the same interface they came in?
https://access.redhat.com/knowledge/solutions/19596
Connecting 2 network interfaces on the same subnet.
Just a snip from your post
->>we need to configure three different network with different gateways. after giving gateway entry on these three files, we restarted network. then only one gateway is showing (route -n). that particular network is pining from outside machine.But we need to ping other 2 ip's from outside machine.
As per the provided route -n command, I do not see any gateway
So which IP/subnet/interface is pingable ?
Linux isn't like Solaris: it doesn't quite grok the concept of multiple default routes in the standard routing module. You have to dance with per-interface routing-tables to achieve something like that (in the iproute2 modules). With Linux, as the network scripts process the ifcfg-IF files, if default gateway directives are set in each file, it will set the gateway to each defined gateway as it processes the files (you can simulate this by doing a `service network stop` and then iteratively `ifup`ing each ifcfg-IF file in your network scripts directory, interspersing an `ip route show` or `netstat -rn` between each `ifup` invocation.
RHEL also has a security setting that causes packets that come in on the "wrong" interface (any off-segment packet that comes into an interface that either isn't associated with the default route or per-NIC policy-route). You can defeat this by doing a `echo 0 > /proc/sys/net/ipv4/conf/<NIC>
If you really need multiple default route type behavior, you'll want to read up on iproute2.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
