network trunking is not working properly

Latest response

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

Can u check article and see whether setting rp_filter to 2 helps or not? https://access.redhat.com/knowledge/solutions/53031

 

If no, you should have to configure policy based routing. http://lartc.org/howto/lartc.rpdb.multiple-links.html

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.

 https://access.redhat.com/knowledge/solutions/30564

 

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>/rp_filter`. This lowers your security posture, so isn't generally recommended. Basically, once you defeat this setting, you'll end up with an asymmetrical-routing configuration (which may be terminated elsewhere in your network): your pings may come in on the desired IP/interface, but replies will get routed back out the default path.

If you really need multiple default route type behavior, you'll want to read up on iproute2.

 

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.