In a SSH server/firewall (192.168.2.3) that has a LAN behind it, say 192.168.2.1/30, will the connection attempts made by the internal machines of the 192.168.2.1/30 network be interpreted by the firewall as incoming or outgoing connections?
If they are read as either incoming or outgoing, must I specify the destination or source address block (192.168.2.1/30)? Or when exactly are the -d or -s options needed?
My understanding is this: if I want those internal machines to make any new connections to the outside world, the rule goes like this.
iptables -A OUTPUT -s 192.168.2.8/30 -m state --state NEW -j ACCEPT
and if the SSH server wanted to make new ssh connections to the outside world the rule would be this
iptables -A OUTPUT -p tcp --sport 22 -m state --state NEW -j ACCEPT
In this case, should I leave out the ssh server ip address or include it in the rule?
Many thanks.