0

It's hard to find the documentaion for --sport and --dport by using "iptables --help" or "man iptables".

iptables --help | grep port
man iptables | grep port

But I can find it from Internet:

https://linux.die.net/man/8/iptables

--source-port,--sport [!] port[:port]
--destination-port,--dport [!] port[:port] 

What's the command for checking the iptables docs for --sport and --dport in offline?

man ?
4
  • 3
    Perhaps man iptables-extensions has what you are looking for? Commented Jul 9 at 1:35
  • 4
    Or man -k iptables and man -a iptables.
    – waltinator
    Commented Jul 9 at 2:38
  • Also once you've found which man page documents the option you're looking for (in this case steeldriver has it right I think, but in general you can use waltinator's method), you can type / while reading the man page, type down stuff and search for strings (in this case --sport / --dport) within the manpage and (hopefully) quickly get to the relevant section instead of grepping stuff. n for the next result, N for the previous result and g to go back at the start.
    – kos
    Commented Jul 9 at 3:13
  • dport/sport question. --dport stands for DESTINATION port. This matches against the target port of the connection. --sport stands for SOURCE port. This is the port on which the packet originated. For example, all http connections have DPORT 80 for packets from client->server, and SPORT 80 for server->client.
    – kyodake
    Commented Jul 9 at 21:10

0

You must log in to answer this question.

Browse other questions tagged .