Link to home
Start Free TrialLog in

asked on

multiple nic cards in linux

Dear Sir/Madam:

when configured two ethernet cards and assign public ip ,subnetmask,  gateway and name server for eth0 and assigin private ip ,subnetmask, gateway and name server for eth1 , after restarting the network services eth1 is taking the nameserver of the eth0 , how to configure eth1 with the different gateway and name servers , is it by manually editing the /etc/sysconfig/network-scripts/ifcfg-eth1 and adding the entires BROADCAST=x.x.x.x , NETWORK=x.x.x.x , GATEWAY=x.x.x  and then adding nameserver for eth1 , please suggest on this .


Avatar of ravenpl
Flag of Poland image

You can have only one default gateway per system and usually it's configured in /etc/sysconfig/network
(In fact it's possible to have multiple default gateways - but it's really unusuall and it's only for boxes acting as advanced(!) router)
Exactly same applied to nameserver.

Why You want have different routes/nameservers? What would be the rules for choosing first or second route/NS ?


thanks for the reply , the reason is i want the linux box with two nic to work as ftp server webserver  , firewall , squid and the name server for lan ( for local resolving) , users outside can login to the server by ftp and upload the files ,the same can be accesed by the quality team in the lan by using the samba share of their home directory , so all the lan systems should use linux box as the name server listening to eth1 private ip , for this purpose only i wanted different name server for the eth0 ( public ip) and eth1 ( private ip).
 as of now i have done this by making the linux box as cache name server this is working fine is there any other methods because iam migrating from the redhat v.09 to RHEL V.04 now also wanted to deploy LAMP in the same server.

please update me on this regard

Read my previous post: I asked why You want two default gateways OR nameservers configured.
If You intend to be as dns proxy/cache then You propably should set the very same box as namerver for the box. Why ask another one?
thanks again for the reply , sorry for not mentioning the following point in the previous question , eth0 is  configured to one ISP and eth1 is for another ISP , eth1 connection with ADSL modem which uses private ip .hence two different gateways and name servers.

Avatar of ravenpl
Flag of Poland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the support
yes i use the local dns cache , can you suggest me in this case that is i have redhat ES v.o4 with sendmail as MTA working a mailserver this is HP server as of now one nic of static ip with the gateway of router and using the  nameserver of the ISP but now i want to setup the same server as samba server by adding one more nic i,e  eth1 with the private ip assigned to it and the name server entires for this private ip to be assigned of the other linux box which works as name server in out setup  , please suggest me in this case so that linux box -2 should work as mail server and as well samba server which means eth1 one should use the different name server i,e is name server of the linux box -1
which is the name server in our lan , please suggest me on this.
Avatar of ssvl
use route