2nd NIC causes machine to go offline

Issues related to configuring your network
Post Reply
wheresjim
Posts: 4
Joined: 2007/05/07 21:53:00

2nd NIC causes machine to go offline

Post by wheresjim » 2007/05/07 22:07:32

I have a machine that I installed CentOS 4.4 on, and it has a NIC card built into the motherboard, and I added a Gigibit NIC card made by Netgear (GA 311) as well. The internal card serves the WAN directly with a static IP as eth0, and the Gigabit NIC card is supposed to serve my local LAN only (class C network) as eth1. The built in card serves just fine by itself, but when I enable the Gig NIC on the LAN, suddenly the machine is no longer reachable via the WAN. Minimal services are running on the machine, basically just an Apache Tomcat server and a Postgresql server.

Anybody have any idea where I should start? I'm more of a programmer than a sysadmin, but my cheapskate boss is too cheap to hire both.

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: 2nd NIC causes machine to go offline

Post by michaelnel » 2007/05/07 22:17:16

As a start, with both interfaces up, post the output of "ifconfig" and "route -n".

wheresjim
Posts: 4
Joined: 2007/05/07 21:53:00

Re: 2nd NIC causes machine to go offline

Post by wheresjim » 2007/05/07 22:58:26

Wow, thanks, I really appreciate this.

OK, I x'd out parts I'd like to keep private (for obvious reasons) but 2 things strike me immediately, the broadcast address on eth0 seems weird to me, it may be because of the netmask, which I took the setting of another server we have. Second the fact that there is no gateway listed in the route output for eth0, and there appear to be 3 listings for eth1. am I on the right track?

Here's ifconfig

eth0 Link encap:Ethernet HWaddr 00:13:D3:55:76:E4
inet addr:xx.xx.xx.117 Bcast:xx.xx.xx.127 Mask:255.255.255.240
inet6 addr: xxxx::xxx:xxxx:xxxx:76e4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:73294 errors:0 dropped:0 overruns:0 frame:0
TX packets:54731 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41115236 (39.2 MiB) TX bytes:42681694 (40.7 MiB)
Interrupt:217 Base address:0xdd00

eth1 Link encap:Ethernet HWaddr 00:14:6C:C0:16:58
inet addr:192.168.12.205 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr: fe80::214:6cff:fec0:1658/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:177 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1595 errors:0 dropped:0 overruns:0 frame:0
TX packets:1595 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1553334 (1.4 MiB) TX bytes:1553334 (1.4 MiB)


Here's route -n

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
xx.xx.xx.117 0.0.0.0 255.255.255.240 U 0 0 0 eth0
192.168.12.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 192.168.12.1 0.0.0.0 UG 0 0 0 eth1

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: 2nd NIC causes machine to go offline

Post by michaelnel » 2007/05/07 23:15:55

I think you probably want your default route to be on eth0, not eth1.

Check the /etc/sysconfig/network-scripts/ifcfg-eth* files. The GATEWAY statement should be in ifconfig-eth0. You shouldn't have a GATEWAY statement in ifcfg-eth1.

BTW, it's the "UG" designation in the route -n output that shows the default route.

[code]0.0.0.0 192.168.12.1 0.0.0.0 [b]UG[/b] 0 0 0 eth1[/code]

wheresjim
Posts: 4
Joined: 2007/05/07 21:53:00

Re: 2nd NIC causes machine to go offline

Post by wheresjim » 2007/05/07 23:21:43

Cool. Many thanks! Guess I shouldn't have sniffed so much glue when I was doing the setup!

:pint: Beers to you!

wheresjim
Posts: 4
Joined: 2007/05/07 21:53:00

Re: 2nd NIC causes machine to go offline

Post by wheresjim » 2007/05/10 00:42:47

Well, that worked great, except now I cannot reach the machine from the local net using the 192.168.12.x address. Basically my plan is to have the nic designated as eth0 on the WAN, and have the nic designated as eth1 on my lan (both cards are plugged into separate routers), with the eth0 being accessible from the internet and eth1 only accessible from the LAN.

The ultimate goal being to be able to set iptables (I already have those settings, but until I get this thing set up properly I have iptables and most services turned off) to allow certain services only from the LAN (i.e. database access and SSH), using the LAN address, while serving a website and a couple of other services on the WAN.

Post Reply

Return to “CentOS 4 - Networking Support”