View Single Post

  #1 (permalink)  
Old 01-16-2004
Andrew P. Billyard
 
Posts: n/a
Default Problems with broadcast? with two ethernet adaptors up

Hi ALL,

This is different than my last post so please read on...

In my box I have two ethernet adaptors: an SMC EZNET-PCI (as eth0) and a
3COM 905TX (as eth1 to be used as a connection for my laptop). The
following problem occurs whether I have my firewall (iptables) running or
not. When the eth1 card is brought up (via "ifup eth1") I can
*only* access the outside world (via eth0) if I use IP numbers:

ping 130.15.26.30
ssh 130.15.26.30

But if I try it with ip names, the system just sits there with no output
whatsoever (not even error messages or "can't resolve host" type messages)

ping astro.queensu.ca
ssh astro.queensu.ca

(there isn't even any activity light with my DSL box).

So I started to fiddle with the script ifup, inserting "exit;" commands
throughout to find out where this problem arises and it's with the command:

ip addr add ${IPADDR}/${PREFIX} \
brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE};

(executed in an if...then statement), where
${IPADDR}=192.168.1.25
${PREFIX}=24
${BROADCAST}=192.168.1.255
${REALDEVICE}=eth1
${SCOPE}=
${DEVICE}=eth1

I know that this is the offending command since I inserted an exit;
statement in ifup before this statement, ran "ifup eth1", ran "ping
astro.queensu.ca" (which worked), ran "ip addr add 192.168...." and then
ran "ping astroq.queensu.ca" again and it failed.

The output to "ip addr list", before and after the offending statement is
executed is:

BEFORE:
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
4: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:e0:29:8d:f0:84 brd ff:ff:ff:ff:ff:ff
inet 10.40.188.180/28 brd 10.40.188.191 scope global eth0
6: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:50:04:16:6f:5e brd ff:ff:ff:ff:ff:ff


AFTER:
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
4: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:e0:29:8d:f0:84 brd ff:ff:ff:ff:ff:ff
inet 10.40.188.180/28 brd 10.40.188.191 scope global eth0
6: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:50:04:16:6f:5e brd ff:ff:ff:ff:ff:ff
inet 192.168.1.25/24 brd 192.168.1.255 scope global eth1

Now, if I execute the following

ip addr flush dev eth1
ip addr add 192.168.1.25 brd 192.168.1.255 dev eth1 label eth1

(i.e., I specify ${IPADDR} rather than ${IPADDR}/${PREFIX}) everything
works!

Can anyone see the problem here? This networking is really new to me so
I'm not even sure what I should be looking for. So,

What is the significance of the "/24" in the IP address?
Where can I turn it off?
Should I turn it off?
Should it be a specific number?

For completeness, I've included some of my machine's
configures and (hopefully) key files below.

Cheers,
Andrew

================================================== ====
uname -a:
------------------------------------------------------
Linux billyard 2.4.22-1.2135.nptl #1 Mon Dec 15 15:46:09 EST 2003 i586 i586 i386 GNU/Linux

================================================== ====
Distribution: Fedora Core 1


================================================== ====
/etc/sysconfig/network:
------------------------------------------------------
NETWORKING=yes
HOSTNAME=billyard
GATEWAYDEV="eth0"
FORWARD_IPV4=yes

================================================== ====
/etc/sysconfig/network-scripts/ifcfg-eth0:
------------------------------------------------------
# Realtek|RTL-8029(AS)
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:E0:29:8D:F0:84


================================================== ===
/etc/sysconfig/network-scripts/ifcfg-eth1:
------------------------------------------------------
# 3Com Corporation|3c905B 100BaseTX [Cyclone]
DEVICE=eth1
ONBOOT=no
BOOTPROTO=none
IPADDR=192.168.1.25
NETMASK=255.255.255.0
HWADDR=00:50:04:16:6F:5E
Reply With Quote