sudo nano /etc/hosts.deny
sudo apt install iproute2 ufw
sudo ip address
sudo myipv4=192.168.0.17
sudo myipv6=2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01:2e01
sudo ufw default deny
sudo ufw allow proto tcp from any to $myipv4 port 80
sudo ufw status
sudo ufw allow proto tcp from any to $myipv4 port 443
sudo ufw route allow from $myipv4 port 443 to $myipv4 port 4431
sudo ufw allow proto tcp from any to $myipv4 port 5432
sudo ufw route allow from $myipv4 port 5432 to $myipv4 port 54321
sudo ufw allow proto tcp from $myipv6 port 443 to $myipv6 port 4431
sudo ufw route allow from $myipv6 port 4431 to $myipv6 port 505
sudo ufw allow proto tcp from $myipv6 port 5432 to $myipv6 port 54321
sudo ufw route allow from $myipv6 port 5432 to $myipv6 port 54321
sudo ufw status
sudo ufw route allow from $myipv4 port 443 to $myipv4 port 4431
example :
sudo apt install ufw
sudo ufw allow tcp from any to 192.168.0.40 port 80
sudo ufw status
sudo ufw allow proto tcp from any to 192.168.0.4 port 443
sudo ufw route allow proto tcp from 192.168.0.40 port 443 to 192.168.0.40 port 443167
sudo ufw route allow proto tcp from 192.168.0.40 port 2055 to 192.168.0.40 port 672056
sudo ufw allow proto tcp from any to 192.168.0.40 port 543267
sudo ufw route allow proto tcp from 192.168.0.40 port 5432 to 192.168.0.40 port 6754321
sudo ufw allow proto tcp from 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 443 to 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 674431
sudo ufw allow proto tcp from 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 4431 to 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 67505
sudo ufw allow proto tcp from 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 5432 to 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 5432167
sudo ufw allow proto tcp from 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01:2e01 port 5432 to 2o01:e35:87e7:f670:8ooe:1dff:fedo:2e01 port 5432167
sudo ufw status
Aucun commentaire:
Enregistrer un commentaire