beyraq
(usa Arch Linux)
Enviado em 16/02/2012 - 23:40h
Obrigado, mas ainda não funciona.
PS: Quando ativo o PPTP no iOS, aparece o ppp0 no ifconfig, ele funciona.
[root@arch ~]# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1492 metric 1
inet 10.252.21.74 netmask 255.255.255.192 broadcast 10.252.21.127
ether 22:00:0a:fc:15:4a txqueuelen 1000 (Ethernet)
RX packets 386 bytes 34192 (33.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 280 bytes 39637 (38.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 24
gre0: flags=128<NOARP> mtu 1476 metric 1
unspec 00-00-00-00-FF-C0-00-00-00-00-00-00-00-00-00-00 txqueuelen 0 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 16436 metric 1
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1488 metric 1
inet 10.252.21.74 netmask 255.255.255.255 destination 10.252.21.75
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 47 bytes 4069 (3.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38 bytes 3172 (3.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
#!/bin/bash
IFACE_WEB="eth0"
REDE_INTERNA="10.0.0.0/24"
PORTAS_TCP="20,21,53,80,443"
PORTAS_UDP="53"
PORTAS_REDE_INTERNA="21,22,25,53,53,110,443"
iptables -F
iptables -t nat -F
iptables -X
iptables -t filter -F
iptables -Z
iptables -t mangle -F
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A POSTROUTING -t nat -o eth0 -j MASQUERADE
iptables -A POSTROUTING -t nat -o ppp+ -j MASQUERADE
iptables -t nat -A POSTROUTING -s $REDE_INTERNA -o $IFACE_WEB -j MASQUERADE
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp --dport 3128 -j ACCEPT
iptables -A INPUT -s $REDE_INTERNA -p icmp --icmp-type 8 -j ACCEPT
iptables -A FORWARD -p tcp -m multiport --dports $PORTAS_REDE_INTERNA -j ACCEPT
iptables -A OUTPUT -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT
iptables -A FORWARD -p tcp -m multiport --dports $PORTAS_TCP -j ACCEPT
iptables -A OUTPUT -p icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i ppp+ -j ACCEPT
iptables -A OUTPUT -o ppp+ -j ACCEPT
iptables -A INPUT -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -p 47 -j ACCEPT
iptables -A OUTPUT -p 47 -j ACCEPT
iptables -F FORWARD
iptables -A FORWARD -j ACCEPT