1

I'm mocking a service, which would in actuality run on 10.1.10.1, and in so doing am trying to redirect the traffic bound for 10.1.10.1 to 127.0.0.1. To create my rule, I'm running

iptables -t nat -A OUTPUT -p tcp -d 10.1.10.1 --dport 443 -j DNAT \
  --to-destination 127.0.0.1:43000

It doesn't report an error, but it also doesn't appear to add it; when I run iptables -L, I don't see it anywhere. Is there a way I can see what might have gone wrong? Or, is this not the right way to do this?

2 Answers 2

3

iptables -L doesn't list NAT rules. To list NAT rules, you have to run

iptables -t nat -L

Similarly, for any NAT based operations (adding a rule, a chain, deleting, listing, etc), you have to specify the -t option.

1

Try :

 sudo iptables -t nat -nvL

One question, were you able to routing https/443 on your localhost? I have exact the same same requirement, but I am not able to route it.

You must log in to answer this question.

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