Sunday, November 1, 2015

sharing connection

To enable the IP forwarding

#!/bin/bash
# test if ip-forward is up - if not, enable it:
#
ipf=$(cat /proc/sys/net/ipv4/ip_forward)
if [[ ipf -eq "0" ]] ; then
    echo "1" > /proc/sys/net/ipv4/ip_forward
fi
#
# forward-masquerade
#
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
#
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
#
iptables -A FORWARD -p tcp --tcp-flags SYN,RST, SYN -j TCPMSS --clamp-mss-to-pmtu

#
service isc-dhcp-server restart


source:
http://unix.stackexchange.com/questions/16754/how-to-share-the-internet-connection

No comments:

Post a Comment