Let us talk about scripts, HTML, Perl, PHP, apache, etc.
-
Stevyn
- SysOp
- Posts:1786
- Joined:Mon Nov 09, 2009 10:03 am
- Location:Japan
-
Contact:
iptables ubuntu
Post
by Stevyn » Sat Jan 08, 2022 12:47 pm
https://upcloud.com/community/tutorials ... es-ubuntu/
Listing current rules
Iptables can track the state of the connection, so use the command below to allow established connections to continue.
Code: Select all
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
ssh
Code: Select all
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
default rule to drop will permit only specifically accepted connection
save
Code: Select all
iptables-save > /etc/iptables/rules.v4
restore
Code: Select all
iptables-restore < /etc/iptables/rules.v4
ip6tables-restore < /etc/iptables/rules.v6
Contact me directly: Ironfeatherbooks (@) gmail.com
-
Stevyn
- SysOp
- Posts:1786
- Joined:Mon Nov 09, 2009 10:03 am
- Location:Japan
-
Contact:
Post
by Stevyn » Sat Jan 08, 2022 12:49 pm
auto restore at boot
Code: Select all
apt-get install iptables-persistent
Contact me directly: Ironfeatherbooks (@) gmail.com