Click to See Complete Forum and Search --> : 24bit subnet but broadcast is 16bit??
smythe
08-07-2003, 02:14 PM
Hello-
I am having a issue with a RH 8 box, eth1 is broadcasting at 16bit even though the subnet is 24bit? I set the eth1 address using:(generic numbers)
ifconfig eth1 172.x.x.1 netmask 255.255.255.0 gw 172.x.x.100
Then when I run ifconfig it shows eth1 like this:
inet addr:172.x.x.1 Bcast:172.x.255.255 Mask:255.255.255.0
Any Ideas as to why this would happen?
Thanks
J
ph34r
08-07-2003, 02:42 PM
'cause 172.foo is a /16 network?
Try
ifconfig eth1 172.x.x.1 netmask 255.255.255.0 gw 172.x.x.100 broadcast 172.x.255.255
ph34r is right-
In classful addressing, 172. falls in Class B , which would have the broadcast address you're seeing. My guess is that because you didn't explicitly specify a broadcast address in your ifconfig command, the system is automatically generating what it thinks is the right address for the IP address you're using. Try specifying the broadcast address when you issue the ifconfig command, or hard-code your broadcast address in /etc/sysconfig/network-scripts/ifcfg-eth1 file.
smythe
08-07-2003, 05:53 PM
I knew that its a different class of address, thats just the way it is ...(dont ask ) ...right after I posted I realized that I would change the broadcast with ifconfig....(very long day) .. it still is not working the way it should....
Let me ask you this ... being that I have two NICs, I have given them both address' and I have them disco'd from the switch .. would I still be able ping from one iface to the other....via the mobo?
or could I use a x-over cable to each and test them that way.... it could be possible that one card is not working...(which right now thats the way I am leaning)?
Thanks
J
Originally posted by smythe
I knew that its a different class of address, thats just the way it is ...(dont ask ) ...right after I posted I realized that I would change the broadcast with ifconfig....(very long day) .. it still is not working the way it should.... Not working in exactly what way(s)? Give us some examples and/or post any errors you're getting.
Originally posted by smythe
Let me ask you this ... being that I have two NICs, I have given them both address' and I have them disco'd from the switch .. would I still be able ping from one iface to the other....via the mobo?Hmm, not sure- what are the IP of both NICs, and what does your routing table look like (the "route" command will tell you that)?
Originally posted by smythe
or could I use a x-over cable to each and test them that way.... Never tried, but I'd bet that if it is possible, both NICs would have to be on the same net/subnet.
bandwidth_pig
08-07-2003, 09:21 PM
Originally posted by smythe
I knew that its a different class of address, thats just the way it is ...(dont ask ) ...right after I posted I realized that I would change the broadcast with ifconfig....(very long day) .. it still is not working the way it should....
Let me ask you this ... being that I have two NICs, I have given them both address' and I have them disco'd from the switch .. would I still be able ping from one iface to the other....via the mobo?
or could I use a x-over cable to each and test them that way.... it could be possible that one card is not working...(which right now thats the way I am leaning)?
Thanks
J
As far as pinging the two NICs while unplugged from the Switch I am pretty sure you can as long as you have ip forwarding enabled on your Linux box. With this being the case, you will need to have each NIC on a seperate subnet, or it won't work (no need to forward IPs on the same subnet...thats what broadcasting is for) but it will work...but only if you enable IP forwarding. But as you had implied, you could just hook a cross over cable between the two NICs and ping away. That would be the simplest route. But from a curiosity perspective, I know where your coming from. Only reason I know this is I recently did something similar when building a Linux gateway for my LAN. I could only ping the other NIC in the same box if they were on seperate subnets. Cowanrl walked me through it (thanks again Cowanrl...you were a huge help).
smythe
08-08-2003, 09:20 AM
Thanks for your input, here is whats going on.... the box (rh8) has 3 nics, I am not concerned with eth2 at the moment, I just need to get the others working first. The addys are class B with a class C subnet, I can not ping from eth0 to eth1:
Ping -I eth0 172.xx.x.21 (eth1)
Ping 172.xx.x.21 (172.xx.x.21) from 172.xx.x.20 eth0: 56(84) bytes of data
64 bytes from 172.xx.x.21: icmp_seq=1 Destination host unreacable
64 bytes from 172.xx.x.21: icmp_seq=2 Destination host unreacable
Ping -I eth0 172.xx.x.xxx (gateway)
Ping 172.xx.x.xxx (172.xx.x.xxx) from 172.xx.x.20 eth0: 56(84) bytes of dat
64 bytes from 172.xx.x.xxx: icmp_seq=1 ttl=255 time=0.459 ms
64 bytes from 172.xx.x.xxx: icmp_seq=2 ttl=255 time=0.459 ms
from eth1:
Ping -I eth1 172.xx.x.20 (eth0)
Ping 172.xx.x.20 (172.xx.x.20) from 172.xx.x.21 eth1: 56(84) bytes of data
64 bytes from 172.xx.x.20: icmp_seq=1 Destination host unreacable
64 bytes from 172.xx.x.20: icmp_seq=2 Destination host unreacable
Ping -I eth1 172.xx.x.xxx (gateway)
Ping 172.xx.x.xxx (172.xx.x.xxx) from 172.xx.x.20 eth0: 56(84) bytes of dat
64 bytes from 172.xx.x.xxx: icmp_seq=1 Destination host unreachable
64 bytes from 172.xx.x.xxx: icmp_seq=2 Destination host unreachable
ifconfig:
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:172.xx.x.20 Bcast:172.xx.x.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 METRIC:1
RX packets:52 errors:0 dropped:0 overruns:0 frame:0
TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
-------------
eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:172.xx.x.21 Bcast:172.xx.x.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 METRIC:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
--------
lo Link encap: Local Loopback
inet addr:127.0.0.0 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 METRIC:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
-----------
route:
Destination Gateway Genmask Flags Metric Ref Use iface
172.xx.x.0 * 255.255.255.0 U 0 0 0 eth1
172.xx.x.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 172.xx.x.xxx 0.0.0.0 UG 0 0 0 eth1
default 172.xx.x.xxx 0.0.0.0 UG 0 0 0 eth0
The one thing that I noticed , but I am not sure if its anything is why isnt eth1 say UP BROADCAST RUNNING MULTICAST? Does this meant that the iface is not actually UP?
Thanks again
J
bandwidth_pig
08-08-2003, 03:41 PM
The interface is up. Try entering:
echo 1 > /proc/sys/net/ipv4/ip_forward
Then try and ping the interfaces from eachother.
smythe
08-08-2003, 04:07 PM
no go....
echo 1 > /proc/sys/net/ipv4/ip_forward
ping -I eth0 172.xx.x.21
Ping 172.xx.x.21 (172.xx.x.21) from 172.xx.x.20 eth0: 56(84) bytes of data
64 bytes from 172.xx.x.21: icmp_seq=1 Destination host unreacable
64 bytes from 172.xx.x.21: icmp_seq=2 Destination host unreacable
I was playing around with the routes for eth0 , I can now ping and address past the gw...but I can not ping to a machine on the same network ..from eth0 ...not eth1.
agian Thanks
J
bandwidth_pig
08-08-2003, 04:38 PM
You are on seperate subnets right? For example, if your going from 172.18.8.21 to 172.18.8.20...it's not going to work. You'll have to do briding in that case if I am not mistaken. I could be. I have not done what you are doing. But I think you might find this a interesting read. Note the IPs.
http://www.linuxvirtualserver.org/Joseph.Mack/HOWTO/LVS-HOWTO.transparent_bridging.html
smythe
08-08-2003, 06:21 PM
Thanks-
I dont think bridging should be necessary, (although I will keep that link, as it may prove usefull at some point).. what I am going to do is bring down eth1 , and focus on eth0 for now....as it stands right now I am able to ping the gateway fine from eth0 but I can not ping beyond that, or another machine on the same network...I was able to at one point but it stopped.....
Thanks again
J
justlinux.com
Copyright 2007 Jupitermedia Corporation All Rights Reserved.