Click to See Complete Forum and Search --> : Two NIC's on a webserver.


LrnLnx
03-27-2004, 01:08 PM
I have a web server NAT'ed behind a filewall using the IP address:
192.168.3.1 the gw is 192.168.3.41

Here is the route table

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.3.41 0.0.0.0 UG 0 0 0 eth0

I would like to bring up the second NIC using 192.168.2.1

But when I do the webserver no longer responds.
I don't need routing between the two NICs so it doesn't seem to fall into the majority of the routing posts I've seen here. I guess the best way to describe what I'm trying to do it have two NICs one with a "public" address (the 3.1) and a private (2.1) address for for administration.

With second NIC enabled:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 eth0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.3.41 0.0.0.0 UG 0 0 0 eth0

What am I missing?

Hayl
03-27-2004, 01:12 PM
did you check your server's config to make sure it is set to listen on the interface you want (192.168.2.1) ?

In apache2, the setting is "BindAddress"

LrnLnx
03-27-2004, 01:15 PM
I only want the webserver (tomcat) to listen on the 192.168.3.1 address and it is configured this way. I only need the 192.168.2.1 subnet for administration (ssh)

Satanic Atheist
03-27-2004, 02:35 PM
Use IPTables to block the port on the second NIC - it won't respond then. Not quite what you want, but it works.

Also:

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.3.41 0.0.0.0 UG 0 0 0 eth0
And
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 eth0
192.168.2.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.3.41 0.0.0.0 UG 0 0 0 eth0
Anyone see anything wrong with the highlighted lines?

Your machine should not have 169.xxx.yyy.zzz lines anywhere - these are arbitrary IP addresses used by a NIC if the DHCP server is down or otherwise unreachable. (Can someone confirm if they are OK in the routing table though even if everything is working?)

James

LrnLnx
03-27-2004, 06:09 PM
I can try to remove them.
How do I remove these 169. addresses

route del doesn't seem to work.