arthurmotainfo
(usa Debian)
Enviado em 28/01/2015 - 01:40h
Minha Interface está ok pois está reconhecendo os link, pois consigo pingar, segue minha conf...
#The loopback network interface
auto lo eth0 eth1 eth2
iface lo inet loopback
#The primary network interface
allow-hotplug eth0
######Rede Local#########
iface eth0 inet static
address 192.168.0.26
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 192.168.0.2 192.168.0.253
dns-search "Nome.Local"
PROXY
#address 192.168.0.26
#netmask 255.255.255.0
#network 192.168.0.0
#broadcast 192.168.0.255
#gateway 192.168.0.1
#dns-nameservers 192.168.0.2 192.168.0.253
# Link 1
iface eth1 inet static
address 189.8.94.162
netmask 255.255.255.0
network 189.8.94.0
broadcast 189.8.94.162
gateway 189.8.94.161
dns-nameservers 189.8.80.50 189.8.80.43
# Link 2
iface eth2 inet static
address 187.60.20.89
netmask 255.255.255.248
network 187.60.20.0
broadcast 189.60.20.95
gateway 189.60.20.94
dns-nameservers 187.60.31.129 8.8.8.8
#allow-hotplug eth1
#iface eth1 inet dhcp
.............................................................................................................
Iptables
#! /bin/bash
#interface de internet:
ifinternet="eth1"
ifinternet="eth2"
#interface de rede local:
iflocal="eth0"
iniciar(){
modprobe iptable_nat
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o $ifinternet -j MASQUERADE
#Só adicione a linha abaixo se usar o SQUID
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j \REDIRECT --to-port 3128
#Só adicione a linha acima se usar o SQUID
iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter
iptables -A INPUT -m state --state INVALID -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i $iflocal -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --syn -j DROP
}
parar(){
iptables -F
iptables -F -t nat
}
case “$1†in
“startâ€) iniciar ;;
“stopâ€) parar ;;
“restartâ€) parar; iniciar ;;
*) echo “Use os parametros start, stop ou restartâ€
esac