Skip to contentSkip to conversation

Stateless NAT

DISCUSSION Matin Tamizi 4 participants 6 messages Jun 7, 2005 – Jul 28, 2005

lore
Share & tools
lore
#0 lore raw

I'm trying to setup stateless NAT on a testbed I'm using for university research on DDoS. We are developing a stateless DDoS prevention tool, but to test the software I need to use stateless NAT to force traffic from outside through one computer, the router, and to the victim.

I tried the NETMAP target module, but the router is still filtering my out of state packets from the attack. The following show the rules in my nat table:

root # iptables -t nat -L
Chain PREROUTING (policy ACCEPT)

target     prot opt source               destination
NETMAP     all  --  anywhere             <victim's ip address> 192.168.13.2/32

Chain POSTROUTING (policy ACCEPT)

target     prot opt source               destination
SNAT       all  --  192.168.13.2         anywhere           

to:<victim's ip address>

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

I appreciate any suggestions on how I could correct my setup so I can use stateless.

#2 lore raw

[email protected] schrieb am 08.06.2005 03:40:36:

Quoted 9 lines
Quoted 4 lines

I appreciate any suggestions on how I could correct my setup so I can use stateless.

You don't use netfilter. You use iproute2.

http://linux-ip.net/html/nat-stateless.html

First your right, iproute2 is the best tool managing simple 1:1 NAT.

Second, is doesn't work because some guys decided to remove the necessary code out of the kernel.
So you HAVE to use netfolter, and I tell you:

First again, it didn't work. Second, no one of the guys out there helps you. I tried to get help, but nothing happend.
I think, natting is against their religion or something like this.

Take an old kernel and use iproute2, the most genial tool in all the net stuff.

#3 lore raw
Quoted 12 lines · On Jun 8, 2005, at 8:56 AM, [email protected] wrote:
Quoted 3 lines

You don't use netfilter. You use iproute2.

http://linux-ip.net/html/nat-stateless.html

First your right, iproute2 is the best tool managing simple 1:1 NAT. Second, is doesn't work because some guys decided to remove the necessary code out of the kernel.
So you HAVE to use netfolter, and I tell you:
First again, it didn't work. Second, no one of the guys out there helps you. I tried to get help, but nothing happend.
I think, natting is against their religion or something like this. Take an old kernel and use iproute2, the most genial tool in all the net stuff.

hello guenter,

thanks you for your answer , so i heard that it is not possible to run iproute2 under osx right ?

i got a script from my ISP
http://www.xaranet.de/dl/xaranet-tunnel.sh

but you need iproute2 so there is no way ?

regards

marc

********************************************************
opencuseeme / peer2peer multiparty conferencing
********************************************************
Marc Manthey
D - 50672 Cologne
West Europe
office: 0049.221.355.80.32
mobile: 0049.177.341.54.81
www.let.de
www.applehelpers.com
aim://macfreak2004
[email protected]

#4 lore raw

Why can't we create a new target module to support stateless NAT for NetFilter like the following link suggests?
https://lists.netfilter.org/pipermail/netfilter/2005-February/058950.html

I tried writing a target module, but I'm a bit baffled by how the target modules work. The existing target modules don't seem to have
any source to modify the packets. If this is possible then the
NETMAP module should already do the job. Assuming the NETMAP target module does what its description states.

We should also be able to write a stateless NAT program using libipq. Even FreeBSD uses a user space program for NAT by using the divert socket api. However, I don't how to define any order in the programs grabbing packets from the QUEUE. In FreeBSD, instead of queueing the packet is rerouted to an internal "divert" port which can be binded to using the standard socket API, but divert socket are more expensive than the NetFilter QUEUE solution.

I've found another solution to my problem without having to use NAT, but it would have been nice if I could have used NAT since my solution is rather contrived.

-Matin

Quoted 53 lines · On 6/8/05, [email protected] <[email protected]> wrote:
Quoted 15 lines · On Jun 8, 2005, at 8:56 AM, [email protected] wrote:
Quoted 3 lines

You don't use netfilter. You use iproute2.

http://linux-ip.net/html/nat-stateless.html

First your right, iproute2 is the best tool managing simple 1:1 NAT. Second, is doesn't work because some guys decided to remove the necessary
code out of the kernel.
So you HAVE to use netfolter, and I tell you:
First again, it didn't work. Second, no one of the guys out there helps
you. I tried to get help, but nothing happend.
I think, natting is against their religion or something like this. Take an old kernel and use iproute2, the most genial tool in all the net
stuff.

hello guenter,

thanks you for your answer , so i heard that it is not possible to run iproute2 under osx right ?

i got a script from my ISP
http://www.xaranet.de/dl/xaranet-tunnel.sh

but you need iproute2 so there is no way ?

regards

marc

********************************************************
opencuseeme / peer2peer multiparty conferencing
********************************************************
Marc Manthey
D - 50672 Cologne
West Europe
office: 0049.221.355.80.32
mobile: 0049.177.341.54.81
www.let.de
www.applehelpers.com
aim://macfreak2004
[email protected]

#5 lore raw
Quoted 9 lines · Dharanikanth Dugginni

Hello Matin,

I saw a post from you about Stateless NAT in linux and you concluded saying you found some solution, I am trying to do some thing similar to that, would you mind sharing the approach you have taken??

Thanks,
-Dhar

I had a *real* special situation since I'm doing this just for a testbed. I was able to get around stateless NAT by using ARP poisoning to force a certain network topology. This approach will work but is not scalable and not recommended.

IMHO, you have the following options:
1. Use a different firewall -- I'm sure you've heard suggestion before.
2. Create a target module -- I couldn't figure out how to do this for
a static NAT, so please let me know if you do
3. QUEUE the packets you want to NAT and use libipq to do the static NATing
4. ARP poisoning (spoofing)

Let me know if you want me to post more information about 3 or 4.

-Matin