Hi,
I have a set up with two ethernet cards. One (eth0) has a static IP
address (192.168.0.1) and links to a LAN and the other (eth1) has a
dynamic IP address (DHCP) and links to the internet via a cable modem. I
am using ip forwarding, and eth1 is masqueraded using iptables. I am
running Mandrake Linux v8 (kernel 2.4).
My problem is this. During start-up, eth0 is brought up first, then eth1
is brought up. However, when eth1 is brought up, its DHCP requests are
routed through eth0 over the LAN rather than to the ISP's DHCP server
through eth1.
If I then shut down eth0, and try to restart eth1, the eth1 DHCP
requests now go through eth1 as required, but with a source address
192.168.0.1, so the DHCP still won't respond.
The only way I can get it to work is by disabling eth0, rebooting (at
which point eth1 starts up OK and gets its DHCP info), then start up
eth0 manually. (I then have to manually start up my local DHCP and DNS
for the LAN because they could not start up on the disabled eth0 during
the boot.)
I know I could swap over the ethernet interfaces so the eth0 becomes the
cable connection and eth1 becomes the lan connection, but before I do
that I just wondered if there is a way to force eth1 to make its DHCP
queries through itself using IP address 0.0.0.0 rather than through
eth0.
I'm sure I'm missing something that should be fairly obvious, but I just
can't see it.
Cheers, Grahame.
PS Thanks to Gerard Paul Java for his great iptraf program, which
allowed me to see what was going on!