2 NIC in linux

Hi all,

i tried to set up two network cards in Linux. During installation, it can detect both; eth0 and eth1. In the GUI, i can click on eth0 and type in the IP add and netmask. In the lower half of the window, I can also enter the gateway,hostname,and DNS servers

When i click on eth1, i can also enter the IP add and netmask. However, the gateway and dns values follows that of eth0. I am fine if the hostname follows that of eth0. (does not matter to me)

I assume this is incorrect because i do not want eth1 to follow the gateway and dns of eth0.

What i would like to achieve is eth0 and eth1 have totally different set of IP add, netmask, dns and gateway. I can't achieve that using the GUI, can anyone shed some light on where is my mistake or how can i achieve it using command line?

Your DNS settings (i.e. those which you define in /etc/resolv.conf) are not per-NIC, they take effect over the whole system.

If you want to configure your network interfaces and routing manually, take a look at the man pages for ifconfig and route.

You may want to post the output of uname -a, and let us know exactly which Linux distribution you're using, as each has it's network configuration files in a slightly different location (/etc/sysconfig/network-scripts in Redhat/SUSE, /etc/conf.d in Gentoo, etc).

Cheers
ZB

Hi zazzybob, the route command solved my issue. thank you.

hi new2ss,
I'm having the same problem, please tell me how did you solve it?
Thanks

You can only have one default route. You can have routes added for a specific network however and "man route" will show you the right way to do that for your system.

Also you may add as many dns server entries to /etc/resolv.conf as you like, however only the first one that replies with answer will be used.

Where and how these settings are configured are dependant on your linux distro, see your distros documentation. One thing is sure though, it will most likely be configurable by changing a text file or two somewhere in the /etc directory. Some creative "grep" and "find" usage should light your way.

Hi,

i used the route command to set up a static route for the second network card.