Problems with broadcast? with two ethernet adaptors up

This is a discussion on Problems with broadcast? with two ethernet adaptors up within the Linux Networking forums, part of the Linux Forums category; Hi ALL, This is different than my last post so please read on... In my box I have two ethernet ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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
  #2 (permalink)  
Old 01-16-2004
Cameron Kerr
 
Posts: n/a
Default Re: Problems with broadcast? with two ethernet adaptors up

Andrew P. Billyard <andrew_billyard@alumni.removethisbit.uwaterloo.ca > wrote:

> AFTER:
> 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


That bit looks all right to my eyes.

> 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,


I'm a newbie to the new iproute2 stuff (actually, less than a newbie).
What is the output of "ip addr list" after you have added the fixed
ip addr add ... command?

What do the routing tables say before and after? I imagine that would be
"ip route list"

> What is the significance of the "/24" in the IP address?


It's the network mask, actually, it's the number of 1's in the network
mask starting from the left, so it would be

255.255.255.0

Recall that each octet can be from 0 to 255, which is 8 bits. 24 is 3*8,
so therefore there are three whole octets with (binary) ones in them.

> Where can I turn it off?


Ideally, you shouldn't. File a bug report. Or just work around it until
its properly fixed.

> Should I turn it off?


Most software should be smart enough to recognise an address such as
192.168.x.x as a /24 network (Used to be called a C class network, and
could be told by the starting three or so bits.)

> Should it be a specific number?


Certainly, you can't expect to just make up numbers willy-nilly. 24 is
correct for you.

PS. Where does it go if you try using traceroute instead of ping?

--
Cameron Kerr
cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/
Empowered by Perl!
Reply With Quote
  #3 (permalink)  
Old 01-16-2004
Clifford Kite
 
Posts: n/a
Default Re: Problems with broadcast? with two ethernet adaptors up

Andrew P. Billyard <andrew_billyard@alumni.removethisbit.uwaterloo.ca > wrote:

> 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,


Sounds very much like the DNS requests are being forwarded through eth1
for some reason. First I'd take a look at /etc/resolv.conf, and then I'd
try running tcpdump on eth1 to see what's going on there. Then I'd do
"ip addr flush dev eth1" and run tcpdump on eth0. (And ping the FQDN
of a host on the Internet in both instances.)

Great description of what you've already done to find the problem!
It seemed to me that where DNS requests go is the only thing left
to check.

> What is the significance of the "/24" in the IP address?


It means that anything sent to a host on the old classful "C" network
192.168.1.0 will go to the LAN to which eth1 is attached (IP addresses
192.168.1.[1-254]).

> Where can I turn it off?


Remove /${PREFIX}.

> Should I turn it off?


No, do that and very likely you won't be able to communicate with other
hosts on your LAN.

> Should it be a specific number?


It defines the LAN hosts' IP address range and hence a LAN network route.
The /24 is for an old classful "C" network and is apropos here.

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


They looked okay to me.

--
Clifford Kite Email: "echo xvgr_yvahk-ccc@ri1.arg|rot13"
PPP-Q&A links, downloads: http://ckite.no-ip.net/
/* Emacs vs vi:
Sort of like a Swiss Army knife versus a rapier. */
Reply With Quote
  #4 (permalink)  
Old 01-19-2004
Andrew P. Billyard
 
Posts: n/a
Default Re: Problems with broadcast? with two ethernet adaptors up

On Fri, 16 Jan 2004 10:35:51 +0000, Andrew P. Billyard wrote:

> Hi ALL,
>
> This is different than my last post so please read on...
>
> ... [etc]


Many thanks to those who responded. I found the error of my ways and feel
like a complete prat for not seeing it. I simply added to
/etc/sysconfig/network-scripts/ifcfg-eth1 the two lines:

NETWORK=192.168.0.0
BROADCAST=192.168.0.255

Although I think it was the absence of the first one which was messing me
up! Such a simple thing, but by the time I wrote the last posting I had
burried myself so deep in the scripting that I couldn't see the forest for
the woods. Perhaps I shouldn't be working on this stuff at 5 am before my
first cup of coffee.

Cheers,
Andrew
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:21 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0