0

Here is rules I put in iptables :

$ iptables -t nat -A PREROUTING 
                -i wlan0 -p tcp --dport 80 -j DNAT --to-destination 19.11.11.1:80
$ iptables -t nat -A POSTROUTING -j MASQUERADE

But when I (terminal) list them, I get destination 0.0.0.0/0 instead of 19.11.11.1 Exactly :

Chain PREROUTING (policy ACCEPT 210 packets, 43762 bytes)
pkts bytes target prot opt in source destination 
0   0    DNAT tcp -- wlan0 * 0.0.0.0/0 0.0.0.0/0
    tcp dpt:80 to:19.11.11.1:80

Where am I wrong ? Thank you.

Nota Bene : Traffic comes from 19.11.11.0/24 subnet to 19.11.11.1:80.

2 Answers 2

1

This looks right to me - maybe you are reading the output wrong.

The source and destination (in the packet) TO MATCH is 0.0.0.0/0 0.0.0.0/0 - ie anything, which is consistent with the rule you wrote (you did not specify a source or destination).

The action to take on that packet is to redirect "to:19.11.11.1:80" - ie the text on the following line.

0
2

The destination column lists the destination IP address of the original packet (before NAT) as specified by the -d or --destination parameter. Since you did not specify a destination parameter, the entry matches all TCP packets destined to port 80 on any destination IP address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .