LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables: No chain/target/match by that name. (https://www.linuxquestions.org/questions/linux-networking-3/iptables-no-chain-target-match-by-that-name-4175637418/)

adelphia 08-29-2018 06:13 PM

iptables: No chain/target/match by that name.
 
TLDR;

I can't get IP tables to redirect traffic to a proxy:

Code:

$ sudo iptables -t nat -A PREROUTING -i wlp2s0 -p tcp --dport 80 -j REDIRECT --to-port 8080
[sudo] password for you:
iptables: No chain/target/match by that name.

------------------

I am trying to write a program to unlock my front door but I need to reverse engineer the API used by the lock's Android app. To that end, I'm following these instructions.

I was able to figure out the correct interface name, but beyond that I really don't know what I'm doing here. Any help is greatly appreciated.

berndbausch 08-31-2018 01:15 AM

You are trying to add a rule to table nat, chain PREROUTING. All TCP packets going into wlp2s0 with destination port 80 will have their destination port rewritten to 8080.

It might be that there is no nat table and/or no PREROUTING chain in your device. Run iptables -t nat -S to list all chains in the nat table.

Or your version of iptables requires the -m tcp option?


All times are GMT -5. The time now is 11:20 PM.