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


  Search this Thread
Old 09-17-2008, 10:06 AM   #1
LQ Newbie
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
2 nic's in centos


I have a centos box running as a webserver with 1 nic assigned an IP direct from my T1. I have a 2nd nic installed that I would like to connect to my internal LAN so the webserver can access some data off the LAN. When I connect this 2nd nic the centos server can access the LAN fine but the webserver become unaccessable from the web.

How do I configure I assume IPTABLES to allow both nic's to work? Both have different gateways.

Thank you,
Old 09-18-2008, 02:52 AM   #2
Senior Member
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 69
You need to not set a gateway for the LAN NIC. Add static routes for any subnets that are not on the default subnet assigned to the LAN NIC.
Old 09-18-2008, 02:53 AM   #3
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
From what you are saying i think the second nic changes your default gw making your system unaccessable from the web.

You only need one gateway which is the one u use to get to the internet. The nic on the lan such not use a gateway as the lan is a directly connected network.

I suggest you use static addressing on nic 2 to avoid it using dhcp to overwrite the gateway.
Old 09-18-2008, 07:48 AM   #4
LQ Newbie
Registered: Sep 2008
Posts: 2

Original Poster
Rep: Reputation: 0
That is exactly my problem I think. I did assign nic 2 a static ip on the lan but I also assigned it the lan gateway. I will remove that and try again.

Thanks for your help!


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
need to dual boot centos 5.1 with xp but centos is already installed. extendedping Linux - Software 4 05-13-2008 09:40 PM
printer setup from Centos 5 to Vista home prem. on a headless centos pc ncsuapex Red Hat 6 03-10-2008 12:40 PM
LXer: Install CentOS 5 DomU on CentOS 5 Dom0(64 bit) from NFS share LXer Syndicated Linux News 0 11-09-2007 04:41 AM
LXer: CentOS announces CentOS 5 i386 Live CD LXer Syndicated Linux News 0 07-11-2007 08:01 AM
update centos 4 rc1 to centos 4 trou yum? maxut cAos 2 03-04-2005 03:36 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:18 PM.

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