Atualizar router.sh

This commit is contained in:
2025-09-12 12:19:49 +00:00
parent 2aac7249ea
commit a0271381e1

View File

@@ -1,32 +1,14 @@
#!/bin/bash
echo "Router, ok!"
echo "Atualizando!!"
ip link set up dev enp0s8
ip link set up dev enp0s9
ip link set up dev enp0s10
sleep 5
wget https://git.tmferreira.tec.br/tiago.ferreira/GRC/raw/branch/main/interfaces -O /etc/network/interfaces
wget https://git.tmferreira.tec.br/tiago.ferreira/GRC/raw/branch/main/Router/interfaces -O /etc/network/interfaces --no-check-certificate --no-cache
ip address flush enp0s8
ip address flush enp0s10
ip address flush enp0s9
wget https://git.tmferreira.tec.br/tiago.ferreira/GRC/src/branch/main/Router/sysctl.conf -O /etc/sysctl.conf --no-check-certificate --no-cache
ip address add 172.17.0.1/24 dev enp0s8
ip address add 192.168.200.1/24 dev enp0s9
ip address add 192.168.56.200/24 dev enp0s10
wget https://git.tmferreira.tec.br/tiago.ferreira/GRC/src/branch/main/Router/nftables.conf -O /etc/nftables.conf --no-check-certificate --no-cache
sysctl -w net.ipv4.ip_forward=1
systemctl enable nftables
iptables -t nat -F
iptables -t nat -A POSTROUTING -o enp0s3 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 10000 -j DNAT --to-destination 192.168.200.2:22
iptables -t nat -A PREROUTING -p tcp --dport 10001 -j DNAT --to-destination 192.168.200.3:22
iptables -t nat -A PREROUTING -p tcp --dport 10002 -j DNAT --to-destination 172.17.0.2:22
systemctl restart named
apt clean
poweroff
reboot