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 ?
man iptables-extensions
has what you are looking for?man -k iptables
andman -a iptables
.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 ofgrep
ping stuff.n
for the next result,N
for the previous result andg
to go back at the start.