Skip to contentSkip to conversation

netfilter question

DISCUSSION John Black 2 participants 2 messages Feb 19, 2004

lore
Share & tools
lore

John Black

author
#0 lore raw
Quoted 7 lines

I think you simply need to remove the "-d 161.x.x.x/21" from your rule and

things will start working the way you want.

Regards,

just wanted to make sure this is right.
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 161.x.x.x

<iptables -t nat -L -n> gives me

Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)

target     prot opt source               destination
SNAT       all  --  192.168.0.0/24       0.0.0.0/0          to:161.x.x.x

is that right? so that should mask my internetwork?

john

http://www.arbbs.net/

#1 lore raw
Quoted 7 lines · John Black
Quoted 3 lines

I think you simply need to remove the "-d 161.x.x.x/21" from your rule and

things will start working the way you want.

just wanted to make sure this is right.
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 161.x.x.x

Yes, that's what I meant.

Quoted 5 lines

<iptables -t nat -L -n> gives me

Chain POSTROUTING (policy ACCEPT)

target     prot opt source               destination
SNAT       all  --  192.168.0.0/24       0.0.0.0/0          to:161.x.x.x

A better command is "iptables -t nat -l -nv" because the v option also shows the interface names.

Regards,

Antony.

Signature · 4 lines
I'm pink, therefore I'm Spam.

                                                     Please reply to the list;
                                                           please don't CC me.