LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-17-2008, 10:06 AM   #1
johnmate
LQ Newbie
 
Registered: Sep 2008
Posts: 2

Rep: Reputation: 0
2 nic's in centos


Hello,

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,
John
 
Old 09-18-2008, 02:52 AM   #2
chort
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
datopdog
Member
 
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
johnmate
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!
John
 
  


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
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


All times are GMT -5. The time now is 10:40 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration