Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm working on a debian server and when i add the following rules to forward a port to a lan address:

iptables -t nat -I PREROUTING -p tcp -d 192.168.1.1 --dport 3385 -j DNAT --to-destination 192.168.1.9:3389

iptables -I FORWARD -m state -d 192.168.1.2/10 --state NEW,RELATED,ESTABLISHED -j ACCEPT

i get the following with iptables -L:

    Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.128.0.0/10      state NEW,RELATED,ESTABLISHED                       

the LAN ip address of the debian server is 192.168.1.1 and it is connected to the internet and to the local network over one only interface and all the local network computers have an ip from 192.168.1.2 to 192.168.1.10. I'm using an exact clone of this debian server on another location and i don't have this problem. Thanks for any help.

share|improve this question
    
by mistake, i didn't enabled iptables rules to be loaded at startup and had to re-add iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE . –  user168347 Apr 7 '13 at 1:49

1 Answer 1

up vote 1 down vote accepted

The output you're giving us matches with the input you've given us. There is no issue here. The only thing different is that the bits that are irrelevant due to the mask you chose are not output by iptables, so you see 192.128.0.0/10 rather than 192.168.1.2/10.

If that's a mistake, adjust the mask so that it is the correct value (probably /24) and it should work.

share|improve this answer
    
you're right, i forgot to set iptables rules to be loaded at startup and had to re-add the rule iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE then it worked as expected. –  user168347 Apr 7 '13 at 1:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.