Ask Your Question

iptables -L PREROUTING not showing up

asked 2018-09-08 06:21:22 -0500

GobbleFly gravatar image

Hello, I have struggled with this problem for a few days now and I can't go further if I don't fix it .-

So when I do iptables -L PREROUTING it then shows this error iptables: No chain/target/match by that name.

but if i iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080 it doesn't show up with iptables --list but only with iptables -L -t nat.

So the big problem is when i do sslsplit (to receive the traffic) it doesn't work.

All the other chains do work except the POSTROUTING doesn't work to.

edit retag flag offensive close merge delete



You may want to rerphrase your question as it is very confusing and explain what you actually want to achieve. This sounds like a XY problem. You are talking about PREROUTING, but your last statement is about POSTROUTING. Also, there is no PREROUTING in the filter table which is the default when iptables is called without the -t option and a valid table.

thomaswood gravatar imagethomaswood ( 2018-09-08 12:24:38 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2018-09-11 13:52:59 -0500

GobbleFly gravatar image

The specification is not the problem because when i tried it the first time it worked well. But the second time i might have done something wrong. Is it possible that this is because i iptables -F ? Yes it is confusing, i am unable to understand it myself either. Sorry for my grammatical mistakes(I am not english).

edit flag offensive delete link more

answered 2018-09-09 16:32:21 -0500

fedofix gravatar image

updated 2018-09-10 16:48:31 -0500

Hello GobbleFly

Start by the beguinning ...

So you want to make NAT on your NIC ? Coud you describe what you want to do with option "REDIRECT --to-ports 8080"

edit flag offensive delete link more


I would like to do a sslstrip and redirect all the traffic to port 8080(localhost machine)

GobbleFly gravatar imageGobbleFly ( 2018-10-01 03:44:50 -0500 )edit

answered 2018-09-09 21:35:11 -0500

Pant gravatar image

Prerouting lives in the NAT table. You have to specify the table to look for with -t nat.

Full command: # iptables -t nat -L PREROUTING

edit flag offensive delete link more

Question Tools


Asked: 2018-09-08 06:21:22 -0500

Seen: 273 times

Last updated: Sep 11 '18