iptables v1.8.4 (legacy): unknown option "--to-ports"
xiaxichen opened this issue · comments
Hi I have this question:
system env
Linux version 5.13.0-30-generic (buildd@lcy02-amd64-003) (gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022
about this error
iptables v1.8.4 (legacy): unknown option "--to-ports" Try iptables -h' or 'iptables --help' for more information.
what should i do?
If you want to see the ports using iptables, use the following command below:
sudo iptables -L
This lists your current rules in iptables. If you have just set up your server, you will have no rules, and you should see
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
If you're looking to open up ports, there's more information at these web links:
https://help.ubuntu.com/community/IptablesHowTo
http://www.frozentux.net/iptables-tutorial/iptables-tutorial.html
http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO.html
http://easyfwgen.morizot.net/gen/