All pastes #85690 Raw Edit

Fabio

public text v1 · immutable
·published 2006-07-12 03:40 UTC
rendered paste body
#!/bin/bash

IPT=/usr/sbin/iptables

#Setando ip pra rede local

ifconfig eth1 down
ifconfig eth1 192.168.0.1

#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 enteresse):
$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