Mail archive
alpine-devel

[alpine-devel] Alpine as Gateway

From: Mohsen Ahmadian <mohsen.etc_at_gmail.com>
Date: Fri, 16 Dec 2011 20:54:40 +0330

Hello to all
 I am new in alpine and i want to create a gateway by alpine.
<<internet>>----------<<alpine linux>>------------<<internal>>
            eth1 pppoe eth0 NAT
I config pppoe and firewall (iptables) and any things that need.when i ping
4.2.2.4 the result is true ( in Alpine and the client of it)
but i can't open any site ( or download with wget in alpine) in client.
*what is wrong*??? :-(
*please help me.*
thank you
---------------------------------------
atom:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state
RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state
RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 192.168.0.0/24 anywhere ctstate NEW
ACCEPT all -- 192.168.0.0/24 anywhere ctstate NEW
ACCEPT all -- anywhere anywhere state
RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
----------------------------------------
                interface
----------------------------------------
iface lo inet loopback
iface eth0 inet static
        address 192.168.0.120
        netmask 255.255.255.0
        broadcast 192.168.0.255
--------------------------------------------
rules
-------------------------------------------
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F #ignore if you get an error here
/sbin/iptables -X #deletes every non-builtin chain in the table

/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -m state --state NEW -i ppp0 -j ACCEPT
# only if both of the above rules succeed, use
/sbin/iptables -P INPUT DROP

/sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state
ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT

/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

/sbin/iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT
-----------------------------------------------------------



---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Dec 16 2011 - 20:54:40 UTC