Freesco, NND, CDN, EOS http://forum.freesco.pl/ |
|
HTB i podzial na uslugi... http://forum.freesco.pl/viewtopic.php?f=22&t=11532 |
Strona 1 z 1 |
Autor: | picom [ poniedziałek, 6 marca 2006, 15:42 ] |
Tytuł: | HTB i podzial na uslugi... |
Witam, Możliwe ze ten temat juz się przewinął na grupie, ale jakoś szukam i szukam i coś nie moge znaleźć. W czym sprawa, na dniach będe miał łącze 4MB symetryczne, pod które będzie podpiętych około 200 osób i chciałbym stosunkowo dobrze zarządzać tym łączem, i pomyślałem zeby podzielić je ze względu na usługi, tzn. Chciałbym żeby np. port 80, 21, 22, 53, itp. były ustawiane w kolejce o wyższym priorytecie, a np. p2p miały niższy priorytet i zeby w miare dynamicznie dzielic to łącze. Może ktoś ma jakiś plik konfiguracyjny do poczytania?? pozdr picom |
Autor: | viater [ poniedziałek, 6 marca 2006, 18:12 ] |
Tytuł: | |
Ja korzystałem m.in. z: http://linio.terramail.pl/htb.pdf - super opracowanie !!! http://luxik.cdi.cz/%7Edevik/qos/htb/ http://www.tldp.org/HOWTO/Traffic-Control-HOWTO/ http://rh.cxt.pl/mgr/mgr.htm Poczytaj, na pewno troche sie rozjasni ![]() |
Autor: | picom [ poniedziałek, 6 marca 2006, 20:54 ] |
Tytuł: | |
te linki znam, troche faktycznie rozjaśniły mi sytuacje, ale chciałbym jeszcze poczytać sprawdzone konfigi ![]() picom |
Autor: | KrzySie [ poniedziałek, 6 marca 2006, 21:30 ] |
Tytuł: | |
To gdzieś było na necie, nie przyznaję się do autorstwa. to jest moje rozwiazanie ale na 3 dsl-e. 1 i 3 idzie www, DNS, poczta, ssh, ftp i gry a drugim laczem smieci. Jak troche juz nad tym posiedziales to bedziesz wiedzial co jest do czego #!/bin/sh # podzial lacza # echo 100 DSLWWW1 >> /etc/iproute2/rt_tables # wpisy do tablicy # echo 101 DSLP2P1 >> /etc/iproute2/rt_tables # ale tylko raz # echo 102 DSLWWW2 >> /etc/iproute2/rt_tables # ale tylko raz #echo "Dane wejsciowe" IF0="eth0" #sieciowka z DSL 1MB WWW1 IF1="eth1" #sieciowka z DSL 1MB P2P1 IF3="eth2" #sieciowka z DSL 1MB WWW2 IF2="eth3" #sieciowka z LAN 100 MB IP0="83.27.184.74" #IP serwera na DSL 1 MB IP1="83.27.103.94" #IP serwera na DSL 1 MB IP2="83.27.184.50" #IP serwera na DSL 1 MB IP3="192.168.0.1" #IP serwera od strony LAN P0="83.27.184.73" #IP modemu na DSL 1 MB P1="83.27.103.93" #IP modemu na DSL 1 MB P3="83.27.184.49" #IP modemu na DSL 1 MB P2="192.168.0.1" #IP serwera P0_NET="83.27.184.72/30" #siec od strony DSL 1MB P1_NET="83.27.103.92/30" #siec od strony DSL 1MB P3_NET="83.27.184.48/30" #siec od strony DSL 1MB P2_NET="192.168.0.0/24" #siec od strony LAN function start () { stop iptables -F -t nat iptables -X -t nat #iptables -F -t mangle #iptables -X -t mangle /bin/echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter /bin/echo "0" > /proc/sys/net/ipv4/conf/eth0/rp_filter /bin/echo "0" > /proc/sys/net/ipv4/conf/eth1/rp_filter /bin/echo "0" > /proc/sys/net/ipv4/conf/eth2/rp_filter /bin/echo "0" > /proc/sys/net/ipv4/conf/default/rp_filter ip route flush table DSLWWW1 2> /dev/null ip route flush table DSLP2P1 2> /dev/null ip route flush table DSLWWW2 2> /dev/null ip route add 83.27.184.72/30 dev eth0 src 83.27.184.74 table DSLWWW1 ip route add default via 83.27.184.73 table DSLWWW1 ip route add 83.27.103.92/30 dev eth1 src 83.27.103.94 table DSLP2P1 ip route add default via 83.27.103.93 table DSLP2P1 ip route add 83.27.184.48/30 dev eth2 src 83.27.184.50 table DSLWWW2 ip route add default via 83.27.184.49 table DSLWWW2 ip route add 83.27.184.72/30 dev eth0 src 83.27.184.74 2> /dev/null ip route add 83.27.103.92/30 dev eth1 src 83.27.103.94 2> /dev/null ip route add 83.27.184.48/30 dev eth2 src 83.27.184.50 2> /dev/null ip rule add from 83.27.184.74 table DSLWWW1 ip rule add from 83.27.103.94 table DSLP2P1 ip rule add from 83.27.184.50 table DSLWWW2 # defaultroute ip route delete default #ip route add default via 83.26.154.17 dev eth0 #DSLWWW1 ip route add default via 83.27.103.93 dev eth1 #DSLP2P1 ip route add 192.168.0.0/24 dev eth3 table DSLP2P1 ip route add 83.27.184.72/30 dev eth0 table DSLP2P1 ip route add 83.27.184.48/30 dev eth2 table DSLP2P1 ip route add 127.0.0.0/8 dev lo table DSLP2P1 ip route add 192.168.0.0/24 dev eth3 table DSLWWW1 ip route add 83.27.103.92/30 dev eth1 table DSLWWW1 ip route add 83.27.184.48/30 dev eth2 table DSLWWW1 ip route add 127.0.0.0/8 dev lo table DSLWWW1 ip route add 192.168.0.0/24 dev eth3 table DSLWWW2 ip route add 83.27.184.72/30 dev eth0 table DSLWWW2 ip route add 83.27.103.92/30 dev eth1 table DSLWWW2 ip route add 127.0.0.0/8 dev lo table DSLWWW2 !!!!!!!!!!!!!! tak dla kazdrgo user # 192.168.0.10 ip rule add fwmark 0x1080 table DSLWWW2 # www i podobne ip rule add fwmark 0x1053 table DSLWWW2 # DNS ip rule add fwmark 0x1022 table DSLWWW2 # SSH i telnet ip rule add fwmark 0x1025 table DSLWWW2 # poczta ip rule add fwmark 0x1021 table DSLWWW2 # ftp ip route flush cache # odpalanie forwarding i kierujemy pakiety w odpowienie lacza echo 1 > /proc/sys/net/ipv4/ip_forward iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth0 -j SNAT --to-source 83.27.184.74 iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth1 -j SNAT --to-source 83.27.103.94 iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth2 -j SNAT --to-source 83.27.184.50 a kazdego ruch markowany jest takla bałwan jestem # koki 192.168.0.10 # wszystko iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp -j MARK --set-mark 0x1000 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp -j MARK --set-mark 0x1000 # www iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 80 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 80 -j MARK --set-mark 0x1080 # www szyfrowane iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 443 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 443 -j MARK --set-mark 0x1080 # GG iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 8074 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 8074 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 1550 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 1550 -j MARK --set-mark 0x1080 # gry internetowe na wp.pl iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 5000:5010 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 5000:5010 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 17001 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 17001 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 6100:6120 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 6100:6120 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 4000 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 4000 -j MARK --set-mark 0x1080 # IRC iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 6666:6668 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 6666:6668 -j MARK --set-mark 0x1080 # USENET - grupy dyskusyjne iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 119 -j MARK --set-mark 0x1080 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 119 -j MARK --set-mark 0x1080 # DNS iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 53 -j MARK --set-mark 0x1053 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 53 -j MARK --set-mark 0x1053 # SSH iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 22 -j MARK --set-mark 0x1022 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 22 -j MARK --set-mark 0x1022 # telnet iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 23 -j MARK --set-mark 0x1022 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 23 -j MARK --set-mark 0x1022 # poczta iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 25 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 25 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 110 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 110 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 993 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 993 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 995 -j MARK --set-mark 0x1025 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 995 -j MARK --set-mark 0x1025 # ftp iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 20 -j MARK --set-mark 0x1021 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 20 -j MARK --set-mark 0x1021 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p tcp --dport 21 -j MARK --set-mark 0x1021 iptables -t mangle -A PREROUTING -s 192.168.0.10 -p udp --dport 21 -j MARK --set-mark 0x1021 # powrot iptables -t mangle -A PREROUTING -s 192.168.0.10 -j RETURN # 192.168.0.11 # wszystko iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp -j MARK --set-mark 0x1100 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp -j MARK --set-mark 0x1100 # www iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 80 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 80 -j MARK --set-mark 0x1180 # www szyfrowane iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 443 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 443 -j MARK --set-mark 0x1180 # GG iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 8074 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 8074 -j MARK --set-mark 0x1180 # gry internetowe na wp.pl iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 5000:5010 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 5000:5010 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 17001 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 17001 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 6100:6120 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 6100:6120 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 4000 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 4000 -j MARK --set-mark 0x1180 # IRC iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 6666:6668 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 6666:6668 -j MARK --set-mark 0x1180 # USENET - grupy dyskusyjne iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 119 -j MARK --set-mark 0x1180 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 119 -j MARK --set-mark 0x1180 # DNS iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 53 -j MARK --set-mark 0x1153 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 53 -j MARK --set-mark 0x1153 # SSH iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 22 -j MARK --set-mark 0x1122 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 22 -j MARK --set-mark 0x1122 # telnet iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 23 -j MARK --set-mark 0x1122 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 23 -j MARK --set-mark 0x1122 # poczta iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 25 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 25 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 110 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 110 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 993 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 993 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 995 -j MARK --set-mark 0x1125 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 995 -j MARK --set-mark 0x1125 # ftp iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 20 -j MARK --set-mark 0x1121 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 20 -j MARK --set-mark 0x1121 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p tcp --dport 21 -j MARK --set-mark 0x1121 iptables -t mangle -A PREROUTING -s 192.168.0.11 -p udp --dport 21 -j MARK --set-mark 0x1121 # powrot iptables -t mangle -A PREROUTING -s 192.168.0.11 -j RETURN |
Autor: | picom [ poniedziałek, 6 marca 2006, 22:21 ] |
Tytuł: | |
dzięki za chęci ale chyba nie o to chodziło ![]() picom |
Autor: | KrzySie [ poniedziałek, 6 marca 2006, 22:46 ] |
Tytuł: | |
picom pisze: dzięki za chęci ale chyba nie o to chodziło
![]() picom Fakt chodziło o podział na usługi z priorytetem. ![]() Konfigutator Zciecha można wykorzystać do podziału na klasy następnie zmienić odpowiednio do potrzeb priorytety. Zamarkować po usługach i wrzucić do odpowiednich klas. |
Autor: | picom [ wtorek, 7 marca 2006, 00:22 ] |
Tytuł: | |
ok, dzieki i tak nie o to mi chodziło ![]() pozdr picom |
Autor: | tasiorek [ wtorek, 7 marca 2006, 00:27 ] |
Tytuł: | Re: HTB i podzial na uslugi... |
picom pisze: Chciałbym żeby np. port 80, 21, 22, 53, itp. były ustawiane w kolejce o wyższym priorytecie, a np. p2p miały niższy priorytet i zeby w miare dynamicznie dzielic to łącze.
Htb Zciecha |
Strona 1 z 1 | Strefa czasowa UTC+2godz. |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |