LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-08-2006, 04:18 AM   #1
zzyborg
Registered User
 
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7

Rep: Reputation: 0
spoofed mac address and conflicts


here is my scenario:

MachineA -> eth0 -> MAC1

MachineB -> eth0 -> MAC1 (spoofed to the same MAC as MachineA)
MachineB -> eth1 -> MAC2

MachineB(eth0) connected to a remote network for PPP Over Ethernet (internet Link).

MAchineA(eth0) and MachineB(eth1) connected thru a cross linked cat 5 cable.

That is ,
eth0 in A and eth1 in B are on same network
eth0 in B is on another network.

My intention is to use both Machines A and B for internet link. but when i use MachineB for connecting to internet with eth0 with spoofed MAC address, my local network has problem . i am not able to ping to MachineB(eth1) from MachineA(eth0). Is this because of MAC address conflict ? I believe that same MAC address on two different network doesn't cause any conflicts . Please help me.
 
Old 12-08-2006, 04:58 AM   #2
iamwilliam
Member
 
Registered: Apr 2006
Location: Nairobi
Distribution: CentOS
Posts: 78

Rep: Reputation: 21
Hi
I think you mean IP address (eg. 192.168.100.1)not MAC address.
Now to your problem, if MachineA IP(eth0) is the same as the MachineB IP (eth0). This means that MachineB (eth1) and MachineA(eth0)are on different networks. Therefore they cannot communicate.
To share the internet connection on MachineB(eth0),change MachineA(eth0)to be in the same network as MachineB (eth1). Then enable ip-forwarding and Masquerading on MachineB
 
Old 12-08-2006, 05:01 AM   #3
zzyborg
Registered User
 
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by iamwilliam
Hi
I think you mean IP address (eg. 192.168.100.1)not MAC address.
i meant MAC address *not* IP .
 
Old 12-08-2006, 05:15 AM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Why on earth would you even want to configure two machines with the same MAC address? That doesn't seem to be any good reason to do that.

BTW machine B is going to have MAC1 in it's ARP cache when there's traffic on eth0, so of course that will cause problems.

In order to not cause problems the MACs would need to be on physically separate devices that are also in separate collision domains (i.e. differnet switches). That's not the cause since you're connecting two machines together that have the same MACs, regardless of which interface it's on.
 
Old 12-08-2006, 05:57 AM   #5
zzyborg
Registered User
 
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by chort
In order to not cause problems the MACs would need to be on physically separate devices that are also in separate collision domains (i.e. differnet switches).
i will make it clear once more .

i wanted to use MachineA to connect to internet in case of non availability of MachineB. i spoofed MAC on MachineB coz , the MAC is mapped on the ISPs server.

i spoofed MAC on one of the two NICs in Machine2 to same MAC as of MachineA. One card (eth0 with spoofed MAC) is connected to seperate physical network and other one (eth1) is in my local network . Both are having different network address too . Also its on entirely different switches.

i think the depiction below will help to understand it.

PHP Code:
Current configuration

  Machine A                 
 ___________              Machine B   
 
|         |              ____________  
 
|         |              |          |
 |  
eth0---|---|switch|---|-->eth1   |
 | (
MAC1)  |              |  (MAC2)  | 
 |         |              |          | 
 -----------              |   
eth0---|-------------> ISPPPP Over Ethernet)
                          |  (
MAC1)  |
                          ------------    

Some times i may go for :

 
Machine A
 ___________   
 
|         |   
 |         |   
 |  
eth0---|---> ISPPPP Over Ethernet)
 | (
MAC1)  |   
 |         |   
 -----------   

which resulted in same MAC address
if this still has got any problems , please suggest a work around
 
Old 12-08-2006, 10:54 AM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by zzyborg
i think the depiction below will help to understand it.

if this still has got any problems , please suggest a work around
I understand exactly what you're doing and I already told you it won't work. It doesn't matter that the interfaces with the same MAC are plugged into different switches. One of the machines has a MAC of another machine that it's directly connected to! If machine B has network traffic on eth0, it's going to have MAC1 cached as associated with the IP of mB/eth0. If it gets traffic from machine A it's going to send replies to machine B/eth0, not machine A/eth0 (because it has the MAC in it's cache already). Machine B is physically connected to itself, how could it not know about the MAC address that it has?

You cannot do this the way you have it architected.

It sounds like it doesn't fail-over without you making changes by hand any way, so don't spoof the MAC of the other machine unless that machine is down. You can write a script to ifconfig it with a different hw addr when you need to switch the connection (and switch it back when the first machine comes up!).
 
Old 12-09-2006, 05:21 AM   #7
zzyborg
Registered User
 
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by chort
You cannot do this the way you have it architected.
you are correct chort. i was able to do it on a windows box. but with a minor problem . when i connect to internet using machineA, the page is loaded after some refresh only . may be its because of the ARP caching you mentioned .

i wanted to use internet from machineA thru B ie, both the machines should be up. This may sound stupid but i have no other options.

so can you suggest me a better architecture for doing this .
 
Old 12-09-2006, 05:48 AM   #8
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi zzyborg,

I guess you could spoof another MAC address on machine A to use the configuration as you posted.

The kernel maintains an ARP table do decide where to send the message on an ethernet network. The machine B table must be confused as it thinks machine A has the same MAC address as its eth1.

By the way, what command did you use to spoof it?

Cheers,

Osvaldo.
 
Old 12-09-2006, 10:44 AM   #9
MaizeNBlue2
LQ Newbie
 
Registered: May 2006
Location: Indiana, USA
Distribution: Slackware 12.2
Posts: 23

Rep: Reputation: 15
Call me crazy, but isn't what they make routers for? It allows you to connect your internet into it and use that mac address for the ISP, then distributes the connection to multiple computers.

They aren't very expensive. I've had very little trouble with the Linksys BEFSR41 I maintain at work. You should really look into one.

-Josh-
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Removing spoofed MAC cooljimwhy Linux - Networking 1 08-22-2006 11:04 PM
Spoofed MAC address = no internet BDiddy Linux - Networking 7 09-23-2005 09:03 PM
Tracing Spoofed IP Address socceroos Linux - Security 9 08-08-2005 02:45 PM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 05:33 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 11:33 AM

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

All times are GMT -5. The time now is 09:50 PM.

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