[Nottingham] Problems configuring second network card

Graeme Fowler nottingham at mailman.lug.org.uk
Sat Apr 5 11:23:00 2003


On Sat, 2003-04-05 at 01:07, David Luff wrote:

> I've been running my machine connected to NTL's broadband
<snip>
> Unfortunately I'm having desperate problems configuring the second
> network card in the Linux box.

Following Rob Davies' comments, this is my setup using RH8.

There's two cards, both 3Com 3c905B. One attached to the cable modem,
one to my internal LAN which is running a DHCP server for convenience,
because I'm a lazy sod.

[root@server root]# cat /etc/modules.conf
alias eth0 3c59x
alias eth1 3c59x

[root@server root]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=server
DOMAINNAME=graemef.net
FORWARD_IPV4="yes"
GATEWAYDEV="eth0"

[root@server root]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

[root@server root]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
BROADCAST=192.168.7.255
IPADDR=192.168.7.254
NETMASK=255.255.255.240
NETWORK=192.168.7.240
ONBOOT=yes

...and that means both the cards start up first time, every time,
providing of course NTL's DHCP server isn't playing up. [as an aside,
anyone lost a least in the middle of the lease time only to find you end
up on a different subnet? Bloody annoying, that is]

DHCP server config is:

[root@server root]# cat /etc/dhcpd.conf                          
ddns-update-style ad-hoc;
authoritative;
subnet 192.168.7.240 netmask 255.255.255.240 {
        range dynamic-bootp 192.168.7.241 192.168.7.248;
        default-lease-time 86400;
        max-lease-time 86400;
        option domain-name-servers 192.168.7.254;
        option subnet-mask 255.255.255.240;
        option routers 192.168.7.254;
        option broadcast-address 192.168.7.254;
        option domain-name "internal.graemef.net";
        option lpr-servers 192.168.7.254;
}

I'm using a very, very simple set of iptables to protect the machine. I
only allow connections from outside to my SSH daemon, and I don't care
if anyone comes knocking. There's just so much rubbish kicking round out
there that I got fed up trying to parse the logs in the end!

Also, like Rob mentioned, there's a local caching DNS server running
here (which also does local DNS 'trickery' and secondary for some zones
I use regularly, like the internal ones at work). I also have some
static routing setup to fire stuff up a VPN to the office, but that's
something different entirely.

What do you get if you do ifconfig -a when it's struggling?

Also, you could always boot it up minus networking, then fire up a
couple of concurrent xterms or something, start the network off in one
and watch what processes, net traffic and so on are being generated in
the other one. If you see DHCP or BOOTP requests on your internal LAN,
that would well explain the 'hang' at boot time.

Thinking about it, as long as you define both cards correctly and have
the modules loaded, it may well be that your distro is trying to use the
card you've defined as your internal LAN for the external one - switch
the cables around and see what happens :)

HTH

Graeme
-- 
Graeme Fowler <graeme@graemef.net>