Compare commits
5
Commits
a78eed4604
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f31db8f410 | ||
|
|
02c14a9a4d | ||
|
|
8a3aab7256 | ||
|
|
b55df84897 | ||
|
|
171d983069 |
+33
-13
@@ -1,21 +1,41 @@
|
||||
#!/usr/sbin/nft -f
|
||||
|
||||
flush ruleset
|
||||
|
||||
table inet filter {
|
||||
chain input {
|
||||
type filter hook input priority filter; policy accept;
|
||||
}
|
||||
|
||||
chain forward {
|
||||
type filter hook forward priority filter; policy accept;
|
||||
}
|
||||
chain input {
|
||||
type filter hook input priority 0;
|
||||
policy accept;
|
||||
}
|
||||
|
||||
chain output {
|
||||
type filter hook output priority filter; policy accept;
|
||||
}
|
||||
chain forward {
|
||||
type filter hook forward priority 0;
|
||||
policy accept;
|
||||
|
||||
# Permite pacotes de conexões já estabelecidas
|
||||
ct state established,related accept
|
||||
|
||||
# Permite a rede LAB acessar a Internet
|
||||
iifname "enp0s8" oifname "enp0s3" accept
|
||||
}
|
||||
|
||||
chain output {
|
||||
type filter hook output priority 0;
|
||||
policy accept;
|
||||
}
|
||||
}
|
||||
|
||||
table ip nat {
|
||||
chain POSTROUTING {
|
||||
type nat hook postrouting priority srcnat; policy accept;
|
||||
oifname "enp0s3" counter packets 0 bytes 0 masquerade
|
||||
}
|
||||
|
||||
chain postrouting {
|
||||
type nat hook postrouting priority srcnat;
|
||||
policy accept;
|
||||
|
||||
# NAT da rede LAB para a Internet
|
||||
oifname "enp0s3" ip saddr 172.17.0.0/24 masquerade
|
||||
}
|
||||
|
||||
|
||||
chain PREROUTING {
|
||||
type nat hook prerouting priority dstnat; policy accept;
|
||||
|
||||
+19
-15
@@ -9,34 +9,38 @@ systemctl restart networking
|
||||
apt update
|
||||
apt install ssh -y
|
||||
systemctl restart ssh
|
||||
for i in {10..1}; do
|
||||
echo -ne "Aguarde $i\033[0K\r"
|
||||
sleep 1
|
||||
done
|
||||
sed -i 's/^#PermitRootLogin\s\+prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
apt autoremove --purge isc-dhcp-server -y
|
||||
apt install isc-dhcp-server -y
|
||||
wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dhcpd.conf -O /etc/dhcp/dhcpd.conf --no-check-certificate --no-cache
|
||||
wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/isc-dhcp-server -O /etc/default/isc-dhcp-server --no-check-certificate --no-cache
|
||||
#apt autoremove --purge isc-dhcp-server -y
|
||||
#apt install isc-dhcp-server -y
|
||||
#wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dhcpd.conf -O /etc/dhcp/dhcpd.conf --no-check-certificate --no-cache
|
||||
#wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/isc-dhcp-server -O /etc/default/isc-dhcp-server --no-check-certificate --no-cache
|
||||
|
||||
systemctl enable nftables
|
||||
systemctl restart isc-dhcp-server
|
||||
#systemctl restart isc-dhcp-server
|
||||
#reboot
|
||||
|
||||
apt install bind9 -y
|
||||
#apt install bind9 -y
|
||||
|
||||
wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/named.conf.options -O /etc/bind/named.conf.options
|
||||
#wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/named.conf.options -O /etc/bind/named.conf.options
|
||||
|
||||
wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/named.conf.local -O /etc/bind/named.conf.local --no-check-certificate --no-cache
|
||||
#wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/named.conf.local -O /etc/bind/named.conf.local --no-check-certificate --no-cache
|
||||
|
||||
mkdir -p /etc/bind/domains/fatecseg/
|
||||
#mkdir -p /etc/bind/domains/fatecseg/
|
||||
|
||||
wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/db.fatecseg.edu.br -O /etc/bind/domains/fatecseg/db.fatecseg.edu.br --no-check-certificate --no-cache
|
||||
#wget https://git.tmferreira.tec.br/tiago.ferreira/ASOR/raw/branch/main/Confs/srv1/dns/db.fatecseg.edu.br -O /etc/bind/domains/fatecseg/db.fatecseg.edu.br --no-check-certificate --no-cache
|
||||
|
||||
#wget https://github.com/tmferreira-ti/ASOR/raw/refs/heads/main/Confs/srv1/dns/db.0.17.172 -O /etc/bind/domains/fatecseg/db.0.17.172 --no-check-certificate --no-cache
|
||||
|
||||
echo "domain fatecseg.edu.br" > /etc/resolv.conf
|
||||
echo "search fatecseg.edu.br" >> /etc/resolv.conf
|
||||
echo "nameserver 172.17.0.1" >> /etc/resolv.conf
|
||||
echo "nameserver 172.17.0.2" >> /etc/resolv.conf
|
||||
#echo "domain fatecseg.edu.br" > /etc/resolv.conf
|
||||
#echo "search fatecseg.edu.br" >> /etc/resolv.conf
|
||||
#echo "nameserver 172.17.0.1" >> /etc/resolv.conf
|
||||
#echo "nameserver 172.17.0.2" >> /etc/resolv.conf
|
||||
|
||||
chattr +i /etc/resolv.conf
|
||||
#chattr +i /etc/resolv.conf
|
||||
|
||||
#systemctl restart named
|
||||
reboot
|
||||
|
||||
+1
-1
@@ -51,4 +51,4 @@ systemctl restart ssh
|
||||
|
||||
#chown www-data: -R /dados/paginas/fatecseg/
|
||||
|
||||
#reboot
|
||||
reboot
|
||||
|
||||
Reference in New Issue
Block a user