snat on ecth
No comments1,install system with pppoe
install modules=ppp-udeb
2,update
#vi /etc/apt/sources.list
deb http://debian.cn99.com/debian etch main contrib non-free
deb-src http://debian.cn99.com/debian etch main contrib non-free
deb http://debian.cn99.com/debian-security etch/updates main contrib non-free
deb-src http://debian.cn99.com/debian-security etch/updates main contrib non-free
#aptitude update
#aptitude dist-upgrade
3,install pppoeconf
#apt-cdrom add
#aptitude install pppoeconf
4,set up lan
#vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
#/etc/init.d/networking restart
5,set snat
#vi /etc/sysctl.conf
net.ipv4.ip_forward=1
#vi /etc/ppp/ip-up.d/snat
#!/bin/sh
#
# iptrules
#
LAN_NET=”192.168.0.0/24″
LAN_IF=”eth0″
DSL_IF=”ppp0″ iptables -t nat -A POSTROUTING -o $DSL_IF -j MASQUERADE
iptables -t filter -A FORWARD -i $DSL_IF -o $LAN_IF -m state \
–state RELATED,ESTABLISHED -j ACCEPT
iptables -t filter -A FORWARD -i $LAN_IF -o $DSL_IF -j ACCEPT
Thursday, September 27th, 2007 at 9:31 am and is filed under Network, Note, Unix/Linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.