LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   2 nic's in centos (https://www.linuxquestions.org/questions/linux-networking-3/2-nics-in-centos-670516/)

johnmate 09-17-2008 09:06 AM

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

chort 09-18-2008 01:52 AM

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.

datopdog 09-18-2008 01:53 AM

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.

johnmate 09-18-2008 06:48 AM

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


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