Can't figure out how this is working


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Can't figure out how this is working
# 1  
Old 03-26-2010
Can't figure out how this is working

I have two machines, each with a virtual interface, with the following configurations:

Machine1:
Code:
eth2      Link encap:Ethernet  HWaddr 00:09:6B:19:E5:05
          inet addr:172.16.0.201  Bcast:172.16.0.255  Mask:255.255.255.0
eth2:0    Link encap:Ethernet  HWaddr 00:09:6B:19:E5:05
          inet addr:192.168.131.1  Bcast:172.16.0.255   Mask:255.255.255.0

Please note the broadcast address for the virtual interface.
Code:
Routing table:
Destination     Gateway         Genmask         Flags   MSS Window  irtt  Iface
192.168.131.0   0.0.0.0         255.255.255.0   U         0 0          0  eth2
172.16.0.0      0.0.0.0         255.255.255.0   U         0 0          0  eth2
0.0.0.0         172.16.0.1      0.0.0.0         UG        0 0          0  eth2

Machine 2:
Code:
eth0      Link encap:Ethernet  HWaddr 00:09:6B:6D:BE:D5
          inet addr:172.16.0.202  Bcast:172.16.0.255  Mask:255.255.255.0
eth0:0    Link encap:Ethernet  HWaddr 00:09:6B:6D:BE:D5
          inet addr:192.168.131.15  Bcast:192.168.131.127   Mask:255.255.255.128

Once again, please note the broadcast address for the virtual interface.
Code:
Routing table:
Destination     Gateway         Genmask         Flags   MSS Window  irtt  Iface
192.168.131.0   0.0.0.0         255.255.255.128 U         0 0          0  eth0
172.16.0.0      0.0.0.0         255.255.255.0   U         0 0          0  eth0
0.0.0.0         172.16.0.1      0.0.0.0         UG        0 0          0  eth0

Arp table on Machine 2 prior to pinging machine 1:
? (172.16.0.201) at 00:09:6b:19:e5:05 [ether] on eth0

And after sending a ping from machine 2 to 192.168.131.1:
? (192.168.131.1) at 00:09:6b:19:e5:05 [ether] on eth0
? (172.16.0.201) at 00:09:6b:19:e5:05 [ether] on eth0

To my understanding, this should not have worked, because Machine 1 should not be listening on Machine 2's broadcast address (you'll note I have picked a non-default broadcast for a Class C address on machine 2). But it seems to work.

Can anyone explain how this is working - i.e. how machine 2 is resolving machine 1's MAC?

---------- Post updated at 04:45 PM ---------- Previous update was at 12:28 AM ----------

Moderators, thank you for putting the post in such a nice format! I apologize for the mess it looked like before... Smilie

For anyone interested, this did get resolved with some help from other forums. Apparently ARP (and DHCP) uses a special type of broadcast called "Limited broadcast" (vs. Direct broadcast) which uses the IP of 255.255.255.255 and a link layer address ff:ff:ff:ff:ff:ff:ff. Limited broadcast does not use the network broadcast IP, rather an IP address with all bits set.

Direct broadcast on the other hand sends packets to all hosts in the broadcast domain of the network using the network broadcast IP. Routers will generally not forward limited broadcast packets, but you can forward direct broadcast packets.

Last edited by pludi; 03-26-2010 at 03:15 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with change significant figure to normal figure command

Hi, Below is my input file: Long list of significant figure 1.757E-4 7.51E-3 5.634E-5 . . . Desired output file: 0.0001757 0.00751 0.00005634 . . . (10 Replies)
Discussion started by: perl_beginner
10 Replies

2. UNIX for Dummies Questions & Answers

Can't figure out why this repeats

#!/bin/sh while IFS=: read address port; do : ${port:=443} address=$address port=$port cd $f_location number=`grep "$address" thing.txt -A 1 | grep "addresses=" | cut -d'"' -f2` echo "$address,$port,$number,$answer" >>... (9 Replies)
Discussion started by: shade917
9 Replies

3. UNIX for Dummies Questions & Answers

Can't figure this one out --

I'm putting together a shell script while I'm learning UNIX -- just for myself. It's a little script that simply takes some vendor names and writes them to a file. So far I'm at the stage where the user enters the name of the file and places it in a folder called vendorlists: * ) touch... (5 Replies)
Discussion started by: Straitsfan
5 Replies

4. UNIX for Dummies Questions & Answers

How to figure out what each IP address is used for?

Hi, I have inherited a server at work that has one IP and two virtual IP's. It is live and I want to figure out what each IP is being used for. I thought of NETSTAT but I cannot figure out how to get it to list what each IP is listening for. ANy advice? (8 Replies)
Discussion started by: mojoman
8 Replies

5. IP Networking

How do I figure out the subnet?

Hi, How do I get subnet from this: 10.252.0.138/25 Tnx (2 Replies)
Discussion started by: mehrdad68
2 Replies

6. Shell Programming and Scripting

I can't figure this out? Quick help with sed

I am trying to delete everything in the parenthesis(including the parenthesis) in this text: Wind: from the WNW (290 degrees) at 6 MPH (5 KT) Pressure (altimeter): 29.82 in. Hg (1009 hPa) Temperature: 80.1 F (26.7 C) Dew Point: 72.0 F (22.2 C) Relative Humidity: 76% Trying to make it look... (3 Replies)
Discussion started by: pmoore4321
3 Replies

7. Shell Programming and Scripting

Cant figure out this..

Hi, I need a little help here. I am exporting user info from a PSQL database and everything is working with the exception of this: 10029008:dsAuthMethodStandard\:dsAuthClearText:classword:10029008:2004:10029008:10029008:/home/student/1002/90/08:10029008 It is putting a colon right before the... (1 Reply)
Discussion started by: Stud33
1 Replies

8. Shell Programming and Scripting

Can't figure out else not matching

All, I appreciate any help you can provide on this. I get an "else unmatched" error with this code and can't figure out why. If I remove the 1st if statement through the 1st else the script runs through fine. Any thoughts? #decrypt file sudo -u gpg /usr/bin/gpg... (4 Replies)
Discussion started by: peteroc
4 Replies

9. UNIX for Dummies Questions & Answers

figure it out

hi there i am new to this site and this linux and unix stuff so kind of plz help me out hoe to start the stuff.... (1 Reply)
Discussion started by: cool_dude
1 Replies

10. UNIX for Dummies Questions & Answers

i can not figure this out

I am having problems scripting in UNIX. I am currently attending school and for the first time I am being introduced to scripting. My problem is I am supposed to enhance the spell_check by adding a third optional argument. The third argument is to specify a list of words to be added to the... (1 Reply)
Discussion started by: steph
1 Replies
Login or Register to Ask a Question