Dual NIC question


(Mvogel4949) #1

I’m getting ready to deploy a dual nic system. Just to test both NICs I programmed them with IPs on the same network. Eth0 works with no problems. Eth1 however appears to be programmed but I can’t ping it or access the web gui on the .127 local address. Is this telling me my second NIC is not programmed correctly or am I missing some additional routing in the system?

image


(Dickson) #2

Which one has the default gateway? There can be only one.
and both networks have the same subnet range…that will cause massive weirdness without specific routes in the computer to direct traffic.


(Mvogel4949) #3

image

I was just hoping to test the second NIC. I’m surprised eth1 IP is not pingable though


(Dickson) #4

What is the IP of the machine your are pinging from?
Your default gateway is 192.168.0.1 and your NICS are 192.168.1.x range. (i assume your subnet is 255.255.255.0)
IF you unplug ETH0, does it (eventually) respond?


(Mvogel4949) #5

image

Unplugging eth0 does not seem to make eth1 accessible via http or pingable


(Tom Ray) #6

Why do you need two NICs to assign two IPs from the same subnet? That makes no sense at all.


(Mvogel4949) #7

Agreed. I just wanted to test the second NIC on the machine prior to install. On install it will not be on the same subnet.


(Tom Ray) #8

OK, so here’s a trick to testing something in the lab that will go into production. Setup it like it’s going into production. Stop wasting time with what you’re doing. Assign a second network to the second interface and actually test your routing and everything is working right.

It makes no sense to “lab test” something that doesn’t mimic what it really is going to do. That’s not a real test.


(Dickson) #9

255.255.254.0 subnet ok, that makes a little more sense

To test, hardcode ETH1 to a different subnet, put your test machine on the same subnet (assuming you are hooked up to the same switch) and then test, it should work.


(Mvogel4949) #10

All good points, I’ll utilize a separate subnet that mirrors the installation environment. Thanks for the help


(Mvogel4949) #11

That worked great. Set eth1 to a separate network that mimicked the customer’s and it was visible. How do you then set which eth is the default. If I’m reading this correctly when I added eth1 it switched it to be default and I would like to switch default back to eth0

image


(Andrew) #12

as @dickson said, you can only have 1 default gateway. This can be set in the /etc/sysconfig/network file and make sure to comment out any GATEWAY= values in your /etc/sysconfig/network-scripts/ifcfg files.


(Dickson) #13

Should be able to just adjust the network parameters from the GUI as well,
Admin -> System Admin -> Network Settings

Although its darn handy to know how to do it from the CLI in case you get yourself in a bind.
Set the default gateway to whatever interface your internet is. Then you can add routes to direct traffic out your second (or third or fourth) as required.

In this example,

NIC0 - OFFICE network   192.168.X.X
NIC1 - External/Internet facing   241.144.33.X

you would want likely want to put the default gateway on NIC1. You wouldn’t need any routes for the 192.168.x.x network, assuming that the range is within the subnet mask of your NIC0 config.

In this example,

NIC0 - OFFICE network   192.168.X.X & 172.16.x.x
NIC1 - External/Internet facing   241.144.33.X

the gateway would be on NIC1, but you will need to put in some routes for the office network because your machine won’t know how to get to the 172.16.x.x network. Default gateway ill try and send that traffic out the internet and it will just die.

So put in a route statement with a syntax like this:

route add -net DESTINATIONip netmask NETMASKip gw GATEWAYip dev eth X

And then you’ll want to make sure it still there when you reboot, so you’ll need to do something like this

add it to
/etc/sysconfig/network-scripts/route-ethX

And the syntax would be something like this:
First one tells the system to send traffic to 172.16.0.0 out nic0 as well as 10.2.0.0 traffic out the ip 192.168.1.1 via NIC0

GATEWAY0=192.168.1.1
NETMASK0=255.255.0.0
ADDRESS0=172.16.0.0

GATEWAY1=192.168.1.1
NETMASK1=255.255.0.0
ADDRESS1=10.2.0.0


(system) closed #14

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.