Добрый день.
имеется сервер с центос, подключенный к двум провайдерам(мегалайн, билайн).
пытаюсь настроить следующее
доступ к Казнету через мегалайн, доступ на СНГ через билайн
вот конфиги.
/sbin/ifup ppp0
sleep 55
/sbin/ifdown eth1 && sleep 10 && /sbin/ifup eth1 && cp -f /usr/src/resolv.conf /etc/resolv.conf
sleep 55
/sbin/ifup beeline
sleep 55
##/etc/init.d/routemap start
#
gw1src=`ifconfig ppp0|grep «inet addr»|awk '{print $2}'|cut -d ':' -f 2`
gw1ip=`ifconfig ppp0|grep «inet addr»|awk '{print $3}'|cut -d ':' -f 2`
gw1int=ppp0
gw1mark=1
gw2src=`ifconfig ppp1|grep «inet addr»|awk '{print $2}'|cut -d ':' -f 2`
gw2ip=`ifconfig ppp1|grep «inet addr»|awk '{print $3}'|cut -d ':' -f 2`
gw2int=ppp1
gw2mark=2
ip route add default via $gw1ip dev $gw1int table gw1
ip route add default via $gw2ip dev $gw2int table gw2
ip route add default via $gw1ip dev $gw1int
ip rule add from all fwmark $gw1mark table gw1
ip rule add from all fwmark $gw2mark table gw2
ip rule add from $gw1src table gw1
ip rule add to $gw1src table gw1
ip rule add from $gw2src table gw2
ip rule add to $gw2src table gw2
ip route flush cache
#ip route add equalize default scope global nexthop via $gw1ip dev $gw1int weight 1 nexthop via $gw2ip dev $gw2int weight 1
iptables -t nat -A POSTROUTING -o $gw1int -j MASQUERADE
iptables -t nat -A POSTROUTING -o $gw2int -j MASQUERADE
for i in 212.19.128.0/19 \
212.154.128.0/17 \
82.200.128.0/17 \
88.204.128.0/17 \
89.218.0.0/16 \
92.46.0.0/15 \
95.56.0.0/14 \
178.88.0.0/14; do
iptables -t mangle -A PREROUTING -i eth0 -d $i -j MARK --set-mark $gw1mark
done
iptables -t mangle -A PREROUTING -i eth0 -m geoip --dst-cc RU,UA,BY,KG,UZ -j MARK --set-mark $gw2mark
iptables -t mangle -A PREROUTING -i eth0 -m geoip ! --dst-cc KZ -p tcp --dport 1935 -j MARK --set-mark $gw2mark
захожу на ленту.ру, через мегалайн, хотя по идеи должен заходить через билайн.
помогите где не правильно????