LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-08-2014, 06:10 PM   #1
duffrecords
LQ Newbie
 
Registered: Nov 2009
Location: Los Angeles, CA
Posts: 29

Rep: Reputation: 0
two network adapters, two routes


I have a server with two NICs (each on a different subnet) and I would like traffic for subnet A to pass through eth0 and traffic for subnet B to pass through eth1. I've read several guides and followed their instructions but I can't ping the gateway associated with eth1 or ping eth1 from outside. I know the switch and its VLANs are configured correctly because I can configure a single NIC with an address on either subnet and it works fine; it's just trying to use both NICs simultaneously that doesn't work. All of these guides basically have the same instructions but I must be missing some vital step. What's wrong with this setup?

/etc/sysconfig/network-scripts/ifcfg-eth0
Code:
DEVICE=eth0
TYPE=Ethernet
UUID=d57f960f-84de-4d0d-8f61-a5d526bb9781
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
HWADDR=00:25:90:C9:6D:30
IPADDR=192.168.101.4
NETMASK=255.255.255.0
PREFIX=24
GATEWAY=192.168.101.1
NETWORK=192.168.101.0
BROADCAST=192.168.101.255
DNS1=192.168.100.2
DNS2=192.168.100.3
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
/etc/sysconfig/network-scripts/ifcfg-eth1
Code:
DEVICE=eth1
HWADDR=00:25:90:C9:6D:31
TYPE=Ethernet
UUID=058b9e36-5d9d-4206-9192-c105fe10f2d4
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.103.4
PREFIX=24
NETMASK=255.255.255.0
NETWORK=192.168.103.0
BROADCAST=192.168.103.255
DNS1=192.168.100.2
DNS2=192.168.100.3
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1"
/etc/sysconfig/network-scripts/route-eth0
Code:
192.168.101.0 dev eth0 src 192.168.101.4 table eth0table
default via 192.168.101.1 dev eth0 table eth0table
/etc/sysconfig/network-scripts/route-eth1
Code:
192.168.103.0 dev eth1 src 192.168.103.4 table eth1table
default via 192.168.103.1 dev eth1 table eth1table
/etc/sysconfig/network-scripts/rule-eth0
Code:
from 192.168.101.4/32 table eth0table
to 192.168.101.4 table eth0table
/etc/sysconfig/network-scripts/rule-eth1
Code:
from 192.168.103.4/32 table eth1table
to 192.168.103.4 table eth1table
Code:
[root@virthost1 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.101.0   *               255.255.255.0   U     0      0        0 eth0
192.168.103.0   *               255.255.255.0   U     0      0        0 eth1
192.168.122.0   *               255.255.255.0   U     0      0        0 virbr0
link-local      *               255.255.0.0     U     1002   0        0 eth0
link-local      *               255.255.0.0     U     1003   0        0 eth1
default         192.168.101.1   0.0.0.0         UG    0      0        0 eth0
Code:
[root@virthost1 ~]# ip rule show
0:	from all lookup local 
32760:	from all to 192.168.101.4 lookup eth0table 
32761:	from 192.168.101.4 lookup eth0table 
32762:	from all to 192.168.103.4 lookup eth1table 
32763:	from 192.168.103.4 lookup eth1table 
32766:	from all lookup main 
32767:	from all lookup default
Code:
[root@virthost1 ~]# ip route show
192.168.101.0/24 dev eth0  proto kernel  scope link  src 192.168.101.4 
192.168.103.0/24 dev eth1  proto kernel  scope link  src 192.168.103.4 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 
169.254.0.0/16 dev eth0  scope link  metric 1002 
169.254.0.0/16 dev eth1  scope link  metric 1003 
default via 192.168.101.1 dev eth0
Code:
[root@virthost1 ~]# ping 192.168.101.1
PING 192.168.101.1 (192.168.101.1) 56(84) bytes of data.
64 bytes from 192.168.101.1: icmp_seq=1 ttl=255 time=3.08 ms
64 bytes from 192.168.101.1: icmp_seq=2 ttl=255 time=0.677 ms
Code:
[root@virthost1 ~]# ping 192.168.103.1
PING 192.168.103.1 (192.168.103.1) 56(84) bytes of data.
From 192.168.103.4 icmp_seq=10 Destination Host Unreachable
From 192.168.103.4 icmp_seq=11 Destination Host Unreachable
 
Old 07-08-2014, 06:18 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326

Rep: Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919Reputation: 919
this worx for me:
http://www.linuxquestions.org/questi...6/#post3804866
 
Old 07-08-2014, 07:51 PM   #3
duffrecords
LQ Newbie
 
Registered: Nov 2009
Location: Los Angeles, CA
Posts: 29

Original Poster
Rep: Reputation: 0
Not for me. I still can't use eth1.
 
Old 07-09-2014, 05:42 PM   #4
duffrecords
LQ Newbie
 
Registered: Nov 2009
Location: Los Angeles, CA
Posts: 29

Original Poster
Rep: Reputation: 0
I guess this was set up correctly to begin with but there's something peculiar about the VLAN eth1 was connected to. I don't know what the problem was; a Cisco tech set the VLANs up for me but fortunately I have an additional working VLAN that I can use instead (192.168.102.0 instead of 192.168.103.0). Everything works as expected.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Powerline Network Adapters lothario Linux - Networking 1 07-20-2011 04:02 AM
Static routes using routes/ifroutes-eth-id.. files and default gateway disabled TimtheEagle Linux - Networking 0 05-31-2008 07:08 PM
network adapters fakie_flip Linux - Hardware 1 09-01-2005 08:51 AM
for network adapters arben Red Hat 1 02-17-2004 01:33 AM
Multiple Network Adapters... markstevens Linux - Networking 1 06-16-2003 03:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration