L2 nat


 
Thread Tools Search this Thread
Special Forums IP Networking L2 nat
# 1  
Old 11-14-2008
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  
Old 11-15-2008
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  
Old 11-21-2008
Thanks!

Thanks Lazydog,

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

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

iptables: Invalid argument

thanks.
# 4  
Old 11-21-2008
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  
Old 11-28-2008
Sorry, try this;

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

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

OpenVPN and NAT

Hi. I am attempting to set up an OpenVPN server on my Solaris 11 box by following all the Linux guides. Thus far I have a working VPN that I can connect to and ssh onto my VPN server over which is great but not what I require long term. I would like to route all VPN client requests for addresses... (0 Replies)
Discussion started by: nickb1976
0 Replies

2. Cybersecurity

iptables in a NAT scenario

Hi, I am learning IPTables have this question. My server is behind a firewall that does a PAT & NAT to the LAN address. Internet IP: 68.1.1.23 Port: 10022 Server LAN IP: 10.1.1.23 port: 22 Allowed Internet IPs: 131.1.1.23, 132.1.1.23 I want to allow a set of IPs are to be able to... (1 Reply)
Discussion started by: capri_guy84
1 Replies

3. Infrastructure Monitoring

Snmp and NAT

Hello, I am facing this scenario: three or more remote LAN (peripheral offices), with the same devices (printers, NAS) in each of them. Those LANs have the same network addresses, i.e.192.168.1.* (are connected to WAN via NAT). I need to collect snmp traps from a central server (public IP).... (4 Replies)
Discussion started by: neutrino
4 Replies

4. Solaris

NAT IPFilter

Hi everybody, I'm running on Solaris 10 X86 (update 1009). I would like to make NAT's rule. I explain you. On Solaris, I configure the principal interface e1000g0 with IP : 192.168.0.33 I created the first logical interface like that : ifconfig e1000g0 addif 192.168.0.40 netmask... (0 Replies)
Discussion started by: aureliensm
0 Replies

5. Shell Programming and Scripting

NAT detection

hellou, can anybody help me with nat detection in real time ? i prefer some detection script because i try some nat detection program's for example p0f or i'm using tcpdump, but i would get contain of specific packet. Some ideas? (1 Reply)
Discussion started by: TheTechnic
1 Replies

6. Solaris

Zones - NAT'ing

Hi gurus. Not such a problem, more of a proof of concept. Ive got two zones :- database-1 and database-dr-1 on two different servers. Both zones have different ip addresses. I want to copy the whole zone database-1 over to database-dr-1, which is simple enough, but I want to install... (0 Replies)
Discussion started by: sbk1972
0 Replies

7. IP Networking

NAT address

Hi Could anybody tell me the solaris command to display the NAT address Thanks in advance (5 Replies)
Discussion started by: axes
5 Replies

8. IP Networking

NAT question

i have a firewall with two interfaces eth0 and eth1, eth0 is connected to an external network, and eth0 is connected to a private lan. im using this command for NAT iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth0 -j SNAT --to-source 223.0.0.3 my questions are : 1) how can i... (4 Replies)
Discussion started by: ratamahatta
4 Replies

9. BSD

proxy or NAT

how do i configure proxy in freeBSD or NAT so that when i set it up as a server can connect other to my new gateway (0 Replies)
Discussion started by: AkinOkin
0 Replies

10. IP Networking

FreeBSD - NAT

Hi All! I have a Pentium 100 (32 MBRAM) with FreeBSD 4.4 installed on it and I am using it as a gateway. When I am downloading (or uploading) stuff simultaneously I see that natd is using up to 100% of the cpu capacity, hence the internet connection becomes blocked. My guess is I will have... (1 Reply)
Discussion started by: Ivo
1 Replies
Login or Register to Ask a Question