The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
.
google unix.com



IP Networking Learn TCP/IP, Internet Protocol, Routing, Routers, Network protocols in this UNIX and Linux forum.

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-14-2008
lagigliaivan lagigliaivan is offline
Registered User
  
 

Join Date: May 2008
Posts: 45
L2 nat

Hi All,

Is there any possibility to change the IP address of a package according to its MAC address. It would be a sort of L2 NAT. (i.e. If the MAC address is 00:1A:A0:1E:XX:XX so the dir IP will be 192.168.X.X)

Thanks!.
  #2 (permalink)  
Old 11-15-2008
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
If you are using IPTABLES you could try the following:

Code:
iptables -A PREROUTE -m  mac --mac-source <MAC> -j SNAT <IP>
You could change preroute to what ever you need.
  #3 (permalink)  
Old 11-21-2008
lagigliaivan lagigliaivan is offline
Registered User
  
 

Join Date: May 2008
Posts: 45
Thanks!

Thanks Lazydog,

I executed the following command, but unfortunately it did not work. :-(

iptables -A -m mac --mac-source 00:80:42:1DA:0F -j SNAT --to-source 172.16.1.220

iptables: Invalid argument

thanks.
  #4 (permalink)  
Old 11-21-2008
lagigliaivan lagigliaivan is offline
Registered User
  
 

Join Date: May 2008
Posts: 45
iptables/ebtables.

Somebody know how I can use iptables and ebtables in order to change the IP address of the package according to its MAC.


thanks.
  #5 (permalink)  
Old 11-28-2008
Lazydog's Avatar
Lazydog Lazydog is offline
Registered User
  
 

Join Date: Oct 2008
Location: Chester Co., PA
Posts: 73
Sorry, try this;

Code:
iptables -A PREROUTE -i <IFACE> -m  mac --mac-source <MAC> -j SNAT <IP>
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0