Настройки актуальны для провайдера QWERTY (Центральный телеграф):
прописываем имя компьютера в /etc/hostname:
QWERTY1
меняем параметр net.ipv4.ip_forward в /etc/sysctl.conf:
sysctl -w net.ipv4.ip_forward="1"
устанавливаем dhcp-server:sudo apt-get install dhcp3-server bind9
дописываем настройки в /etc/dhcp3/dhcpd.conf:
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.2 192.168.1.10;
interface eth0;
}
рестартанем dhcp-server:
sudo /etc/init.d/dhcp3-server restart
прописываем правила iptables в /etc/rc.local:
iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
#iptables -t mangle -A PREROUTING -s 192.168.1.0/24 -j TTL --ttl-inc 1
#iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE
iptables --table nat --append POSTROUTING -s 192.168.1.0/24 --out-interface eth1 -j SNAT --to-source ВАШ_ВНЕШНИЙ_IP
#iptables -t nat -A PREROUTING -p tcp --dport 80 -s 192.168.1.0/24 -d ! 192.168.1.0/24 -j REDIRECT --to-ports 3128
#redirect (radmin)
iptables -t nat -A PREROUTING -i eth1 -p tcp -m tcp --dport 4899 -j DNAT --to-destination 192.168.1.3
iptables --append FORWARD --in-interface eth0 -j ACCEPT
/usr/local/sbin/igmpproxy -d -vv /etc/igmpproxy.conf
exit 0
устанавливаем igmpproxy:
wget http://sourceforge.net/projects/igmpproxy/files/igmpproxy/0.1/igmpproxy-0.1.tar.gz/download
tar -xzvf igmpproxy-0.1.tar.gz
./configure
sudo make install clean
##------------------------------------------------------
## Enable Quickleave mode (Sends Leave instantly)
##------------------------------------------------------
quickleave
##------------------------------------------------------
## QWERTY
##------------------------------------------------------
phyint eth1 upstream ratelimit 0 threshold 1
altnet 213.85.187.36
##------------------------------------------------------
## LOCAL LAN
##------------------------------------------------------
phyint eth0 downstream ratelimit 0 threshold 1
# altnet 192.168.1.2
##------------------------------------------------------
## LOCAL WIFI
##------------------------------------------------------
#phyint ath0 downstream ratelimit 0 threshold 1
#phyint wlan0 disabled