LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-07-2012, 12:41 AM   #1
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
Trying to understand how Ethernet works


Hi,
On a LAN, if I have one machine with an IP of 192.168.0.1, and then, with ifconfig, if I say ANOTHER machine on that LAN has an IP of 192.168.0.1, and then a third machine broadcasts a packet with that IP, will both these machines get it? If not, why not?
(I was thinking, it'd be really easy to start sniffing that way, right?)


Thanks.
 
Old 08-07-2012, 01:21 AM   #2
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
If two machines on the same subnetwork use the same IP, there will be a conflict and probably neither of them will be able to use the network, or will be reachable by another machine.
Also, sniffing has nothing to do with what you describe; this is called spoofing. In order to sniff packets you must put your adapter in promiscuous mode.

One more thing. Ethernet doesn't work in IP level. It works with MAC addresses.

Last edited by segmentation_fault; 08-07-2012 at 01:25 AM.
 
Old 08-07-2012, 02:59 AM   #3
Gleylancer
LQ Newbie
 
Registered: Aug 2012
Distribution: Slackware+RHEL
Posts: 24

Rep: Reputation: Disabled
If you broadcast something, both machines with that IP Address will get it. But it won't help much. If you are on TCP level, the applications rely on established connections, and that will not really work if two machines want to establish a connection at the same time from the same IP Address. There is no way you can sniff anything useful that way - for sniffing you don't even need to have any IP Address, because it is performed on a higher layer. Being on a hub network is enough, you'll get each and every ethernet frame that way.
 
Old 08-07-2012, 03:18 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
I might be wrong but if two are on a segment and have the same ip then either the lower of the mac gets locked in or the first in arp gets locked in. Might have to double check that.

Arp is used to map mac to ip so that is part of the issue. That is where I believe it gets locked in. Arp gets lost after some small amount of time so the head arp asker goes out and asks who has 192.168.0.1 and waits for replies. Then it decides which is which to use.

Last edited by jefro; 08-07-2012 at 03:19 PM.
 
Old 08-07-2012, 09:26 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
Here's a good tutorial on subnetting.

http://www.ralphb.net/IPSubnet/index.html

Don't be fooled by the HTML 3.0 look. It's one of the clearest descriptions of how tcp/ip works you will find. (I first stumbled on this on a dot-edu site; my guess is the author retired or moved to another job and put the pages up unchanged on his own domain.)
 
Old 08-08-2012, 04:01 AM   #6
emekadavid
Member
 
Registered: Jul 2012
Posts: 46

Rep: Reputation: Disabled
re: ethernet works

i'd recommend the linux documentation project, tldp.org. search for a network administrator's guide. am reading it myself presently.
tnx
 
Old 08-10-2012, 01:30 PM   #7
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by jefro View Post
I might be wrong but if two are on a segment and have the same ip then either the lower of the mac gets locked in or the first in arp gets locked in. Might have to double check that.

Arp is used to map mac to ip so that is part of the issue. That is where I believe it gets locked in. Arp gets lost after some small amount of time so the head arp asker goes out and asks who has 192.168.0.1 and waits for replies. Then it decides which is which to use.
Actually what happens is that the mac address will flip flop between the two ports on the switch effectively shredding any attempted upper layer sessions. A Cisco swich will report this as a mac address that has seen too many "moves".

Two devices can only "share" and IP address via a mediation mechanism like HSRP, VRRP, GLBP etc. Two simple hosts with the same config will not work properly, either of them.
 
Old 08-10-2012, 01:33 PM   #8
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by resetreset View Post
Hi,
On a LAN, if I have one machine with an IP of 192.168.0.1, and then, with ifconfig, if I say ANOTHER machine on that LAN has an IP of 192.168.0.1, and then a third machine broadcasts a packet with that IP, will both these machines get it? If not, why not?
(I was thinking, it'd be really easy to start sniffing that way, right?)


Thanks.
You are in effect correct. You can use something called ARP spoofing to play man in the middle and can effectively sniff that traffic. Its not quite as simple as what you describe but in essence that what happens.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you understand how autotools works? hydraMax Programming 16 03-20-2012 05:19 PM
Help me understand how cryptsetup works and confirm it can't be used with GParted... xtiansimon Linux - Software 2 07-20-2011 03:51 PM
[SOLVED] understand how traffic control tc works ano Linux - Kernel 2 01-18-2011 05:55 AM
Does anyone understand why the audio works, but will not come through my TV? maestro52 Fedora 1 12-15-2009 07:00 PM
tool to help understand ethernet driver kapsikum Programming 7 06-07-2008 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration