All pastes #83818 Raw Edit

Something

public text v1 · immutable
·published 2006-07-10 03:10 UTC
rendered paste body
root@game-zone:~# cat /etc/rc.d/rc.firewall
#!/bin/bash

IPT=/sbin/iptables

#Setando ip pra rede local

ifconfig eth0 down
ifconfig eth0 10.1.1.75 netmask 255.0.0.0 up

#Liberando forward

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

# Limpando as tabelas
$IPT -F
$IPT -t nat -F
$IPT -t mangle -F

# Definindo politica Accept All 
# (Troque para DROP e abra conexão por conexão caso haja interesse):
$IPT -P INPUT ACCEPT
$IPT -P OUTPUT ACCEPT 
$IPT -P FORWARD ACCEPT
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT

# Macarando conexões da rede
# se sua conexao estiver na interface ppp0 basta trocar o eth0 por ppp0
# a interface ppp0 é usada tb em dial-up, entao, neste caso, troque o eth0
# por ppp0

$IPT -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# Só para garantir:

$IPT -A FORWARD -j ACCEPT