Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-08-2006, 04:18 AM
|
#1
|
Registered User
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7
Rep:
|
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.
|
|
|
12-08-2006, 04:58 AM
|
#2
|
Member
Registered: Apr 2006
Location: Nairobi
Distribution: CentOS
Posts: 78
Rep:
|
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
|
|
|
12-08-2006, 05:01 AM
|
#3
|
Registered User
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7
Original Poster
Rep:
|
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 .
|
|
|
12-08-2006, 05:15 AM
|
#4
|
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:
|
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.
|
|
|
12-08-2006, 05:57 AM
|
#5
|
Registered User
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7
Original Poster
Rep:
|
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---|-------------> ISP( PPP Over Ethernet)
| (MAC1) |
------------
Some times i may go for :
Machine A
___________
| |
| |
| eth0---|---> ISP( PPP Over Ethernet)
| (MAC1) |
| |
-----------
which resulted in same MAC address.
if this still has got any problems , please suggest a work around
|
|
|
12-08-2006, 10:54 AM
|
#6
|
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:
|
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!).
|
|
|
12-09-2006, 05:21 AM
|
#7
|
Registered User
Registered: May 2006
Location: bangalore, india
Distribution: debian sarge, fedora 6
Posts: 7
Original Poster
Rep:
|
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 .
|
|
|
12-09-2006, 05:48 AM
|
#8
|
Member
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519
Rep:
|
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.
|
|
|
12-09-2006, 10:44 AM
|
#9
|
LQ Newbie
Registered: May 2006
Location: Indiana, USA
Distribution: Slackware 12.2
Posts: 23
Rep:
|
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-
|
|
|
All times are GMT -5. The time now is 09:50 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|