Unifix party firewall

#!/bin/sh

  # default
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

  # flush
iptables -t filter -F INPUT
iptables -t filter -F FORWARD
iptables -t filter -F OUTPUT
iptables -t nat -F PREROUTING
iptables -t nat -F POSTROUTING

  # aktivere masquerade

iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0 -d 10.10.0.0/24
iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0 -d 10.10.6.0/24
iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0 -p tcp --dport 8080
iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0 -p tcp --dport 80
iptables -t nat -A POSTROUTING -j MASQUERADE -o eth0 -p tcp --dport 6667

iptables -t nat -A POSTROUTING -p tcp --dport 5190 -j MASQUERADE
iptables -t nat -A POSTROUTING -j MASQUERADE -p icmp
iptables -t nat -A POSTROUTING -j MASQUERADE -p udp

iptables -t nat -A PREROUTING -p tcp --dport 6667 -j DNAT --to-destination 62.121.17
0.37

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 10.10.0.2

 

Dette indlæg blev udgivet i Knowledge Base, Linux, Networking, Old Base. Bogmærk permalinket.

Skriv et svar