Script Routing

 

#!/bin/bash

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -F

iptables -t nat -F

iptables -P INPUT DROP

iptables -A INPUT -i lo -j ACCEPT

iptables -A INPUT -i eth0 -j ACCEPT

iptables -A INPUT -i eth1 -j ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

iptables -t nat -A POSTROUTING -s 192.168.100.1/26 -j MASQUERADE

iptables -t nat -nvL

Lebih baru Lebih lama