From: sergis@banda.lv Date: Sun, 19 Dec 2004 17:44:31 +0000 Subject: [LARTC] router problem Message-Id: <1103478271.41c5bdff3400a@www.banda.lv> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi all i have big problem,I am newbie and my english is bad,but i know you = can help solve my problem. I have box with gentoo,I live in latvia and i have 2 ISP: One isp gives me ip range from 62.85.71.1-62.85.71.15 (62.85.71.1 is gatewa= y) but there is only latvian trafik - no other countries (link is 2 mbit Asinhronus dsl) and other isp who gives me one ip from dhcp adn there ios no trafik limitations (link is 512kbit Asinhronus dsl).I have local net connec= ted to this linux box who haves ip range 10.10.10.11-10.10.10.19 gw is 10.10.10= .1 on my linux box.On this linux box running (mail,dns,web,counter strike server).On local net are more p2p programms,downloaders,e.t.c.When people f= rom "outside" playing on my server hi have extreme lags caused by link owerload= ing and large packet loss.But my priority is cs trafik. I need to priorize this trafik(i know cs have many litle packets) but i need to priorize my cs server.And i need your help.I try wondersharper but without results. With this script i start my box now:(is this correct?) INET_IFACE=3Deth0 INET_NETb.85.71.0/28 INET_GWb.85.71.1 INET_IPb.85.71.10 INET_BCAST_ADRESSb.85.71.15 INET_MASK%5.255.255.240 DSL_IFACE=3Deth2 DSL_NET=81.198.4.0/28 DSL_GW=81.198.4.1 DSL_IP=81.198.7.159 DSL_BCAST_ADRESS=81.198.7.255 DSL_MASK%5.255.252.0 LAN_IFACE=3Deth1 LAN_IP=10.10.10.0 LAN_NET=10.10.10.0/24 LAN_MASK%5.255.255.0 LAN_BCAST=10.10.10.255 INET_IP1b.85.71.2 INET_IP2b.85.71.3 INET_IP3b.85.71.4 INET_IP4b.85.71.5 INET_IP5b.85.71.6 INET_IP6b.85.71.7 INET_IP7b.85.71.8 INET_IP8b.85.71.9 INET_IP9b.85.71.11 LAN_IP1=10.10.10.11/32 LAN_IP2=10.10.10.12/32 LAN_IP3=10.10.10.13/32 LAN_IP4=10.10.10.14/32 LAN_IP5=10.10.10.15/32 LAN_IP6=10.10.10.16/32 LAN_IP7=10.10.10.17/32 LAN_IP8=10.10.10.18/32 LAN_IP9=10.10.10.19/32 IP=3Dip=20 IPT=3Diptables IR=3Droute IFC=3Difconfig echo "1" > /proc/sys/net/ipv4/ip_forward=20 $IFC eth0:1 $INET_IP1 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:2 $INET_IP2 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:3 $INET_IP3 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:4 $INET_IP4 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:5 $INET_IP5 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:6 $INET_IP6 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:7 $INET_IP7 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:8 $INET_IP8 broadcast $INET_BCAST_ADRESS netmask $INET_MASK $IFC eth0:9 $INET_IP9 broadcast $INET_BCAST_ADRESS netmask $INET_MASK ip route flush table main ip route flush table 1=20 ip route flush table 2=20 ip route add 62.85.71.0/28 dev eth0 src 62.85.71.10=20 ip route add 10.10.10.0/24 dev eth1 src 10.10.10.1=20 ip route add 81.198.4.0/28 dev eth2 src 81.198.7.159 ip route add 127.0.0.0/8 dev lo=20 ip route add default via 81.198.4.1 ip route add 62.85.71.0/28 dev eth0 src 62.85.71.10 table 1=20 ip route add 10.10.10.0/24 dev eth1 src 10.10.10.1 table 1=20 ip route add 81.198.4.0/23 dev eth2 src 81.198.7.159 table 1 ip route add 127.0.0.0/8 dev lo=20 ip route add default via 62.85.71.1 table 1 ip route add 62.85.71.0/28 dev eth0 src 62.85.71.10 table 2 ip route add 10.10.10.0/24 dev eth1 src 10.10.10.1 table 2 ip route add 81.198.4.0/28 dev eth2 src 81.198.7.159 table 2 ip route add 127.0.0.0/8 dev lo table 2=20 ip route add default via 81.198.4.1 table 2=20 ip rule add from 62.85.71.2 table 1 ip rule add from 62.85.71.3 table 1 ip rule add from 62.85.71.4 table 1 ip rule add from 62.85.71.5 table 1 ip rule add from 62.88.71.6 table 1 ip rule add from 62.85.71.7 table 1 ip rule add from 62.85.71.8 table 1 ip rule add from 62.85.71.9 table 1 ip rule add from 62.85.71.10 table 1 ip rule add from 62.85.71.11 table 1=20 ip rule add from 81.198.7.159 table 2=20 $IPT -t mangle -F $IPT -A OUTPUT -t mangle -p udp --sport 27015 -j TOS --set-tos Maximize-Throughput=20 $IPT -A OUTPUT -t mangle -p udp --dport 27015 -j TOS --set-tos Maximize-Throughput=20 $IPT -t nat -F $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP1 -j SNAT --to $INET_IP1 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP2 -j SNAT --to $INET_IP2 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP3 -j SNAT --to $INET_IP3 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP4 -j SNAT --to $INET_IP4 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP5 -j SNAT --to $INET_IP5 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP6 -j SNAT --to $INET_IP6 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP7 -j SNAT --to $INET_IP7 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP8 -j SNAT --to $INET_IP8 $IPT -t nat -A POSTROUTING -o $INET_IFACE -s $LAN_IP9 -j SNAT --to $INET_IP9 $IPT -t nat -A POSTROUTING -o $DSL_IFACE -j SNAT --to $DSL_IP for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 > $f done $IPT -A FORWARD -i eth1 -s ! $LAN_NET -j DROP for LIST in `cat /etc/init.d/Scripts/data/lv_iplist`; do ip route add to $LIST via 62.85.71.1 done /etc/init.d/Scripts/data/lv_iplist contains data of my country i subnets (example 81.198.4.0/23 etc) Plz help me.. --------------------------------------------------------------------- Radical ringtones, java games, mobile phone logos, backgrounds http://sms.B= ANDA.LV ! _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/