Freesco, NND, CDN, EOS

http://www.freesco.pl
Dzisiaj jest czwartek, 28 marca 2024, 22:00

Strefa czasowa UTC+2godz.




Forum zablokowane Ten temat jest zamknięty. Nie można w nim pisać ani edytować postów.  [ Posty: 6 ] 
Autor Wiadomość
Post: poniedziałek, 21 lutego 2005, 20:58 
Offline
Użytkownik

Rejestracja: poniedziałek, 4 listopada 2002, 00:50
Posty: 147
Witam. Szykam rozwiazania jak skonfigurowac htb. Mam 3 karty sieciowe eth0 dsl2 Mb/s i eth1, eth2 sieci lokalne. I pytanie jak skonfihurowac htb aby poprawnie dzialao ? dla obydu sieciowek


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: poniedziałek, 21 lutego 2005, 21:01 
Offline
MODERATOR

Rejestracja: wtorek, 31 sierpnia 2004, 23:06
Posty: 3267
Lokalizacja: Katowice
no ja to zrobilem jak znajde chwilke czasu to ci opisze po koleji co jak gdzie

_________________
Obrazek


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: wtorek, 22 lutego 2005, 21:56 
Offline
MODERATOR

Rejestracja: wtorek, 31 sierpnia 2004, 23:06
Posty: 3267
Lokalizacja: Katowice
wiec tak:
to jest konfiguracja na 3xlan (eth0 eth1 eth2) neo na usb
/usr/src/rchtb/ready/fwmarks.htb

: [/] [] ()
IPT=/usr/sbin/iptables

stop()
{
 $IPT -F -t mangle
 $IPT -X -t mangle
}

start()
{
 $IPT -t mangle -A OUTPUT -j MARK --set-mark 1
 $IPT -t mangle -A PREROUTING -s 10.10.10.10 -j MARK --set-mark 2
 $IPT -t mangle -A PREROUTING -s 10.10.10.11 -j MARK --set-mark 3
 $IPT -t mangle -A PREROUTING -s 10.10.10.2 -j MARK --set-mark 4
 $IPT -t mangle -A PREROUTING -s 10.10.10.3 -j MARK --set-mark 5
 $IPT -t mangle -A PREROUTING -s 10.10.10.9 -j MARK --set-mark 6
 $IPT -t mangle -A PREROUTING -s 192.168.0.2 -j MARK --set-mark 7
 $IPT -t mangle -A PREROUTING -s 192.168.1.4 -j MARK --set-mark 8
}

case $1 in
  'start')
    start
    ;;
  'stop')
    stop
    ;;
  *)
    echo -e "\nUżycie: fwmarks.htb start|stop"
esac

/usr/src/rchtb/ready/rc.htb

: [/] [] ()
#!/bin/bash
# rc.htb 0.3.3-stable, (C)PriSM 2oo3, GNU GPL
# <http://www.rc.htb.prv.pl/>
# Poprawki Zciech 0.1
# wygenerowano: 01/05/05 20:14:04

VER=0.3.3-stable

stop()
{
 /sbin/rchtb_tc qdisc del root dev ppp0 2> /dev/null
 /sbin/rchtb_tc qdisc del root dev eth0 2> /dev/null
 /sbin/rchtb_tc qdisc del root dev eth1 2> /dev/null
}

start()
{
 stop # dla bezpieczeństwa

 # INTERFEJS ETH0 (ruch przychodzący)
 /sbin/rchtb_tc qdisc add dev eth0 root handle 1:0 htb default 3 r2q 1
 /sbin/rchtb_tc qdisc add dev eth1 root handle 1:0 htb default 3 r2q 1

 # Główna klasa dla eth0
 /sbin/rchtb_tc class add dev eth0 parent 1:0 classid 1:1 htb rate 90000kbit ceil 90000kbit
 /sbin/rchtb_tc class add dev eth1 parent 1:0 classid 1:1 htb rate 90000kbit ceil 90000kbit

 # Podział na pasmo dla łącza internetowego i resztę
 /sbin/rchtb_tc class add dev eth0 parent 1:1 classid 1:2 htb rate 126kbit ceil 126kbit
 /sbin/rchtb_tc class add dev eth0 parent 1:1 classid 1:3 htb rate 89874kbit ceil 89874kbit prio 9
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:3 sfq perturb 10

 /sbin/rchtb_tc class add dev eth1 parent 1:1 classid 1:2 htb rate 126kbit ceil 126kbit
 /sbin/rchtb_tc class add dev eth1 parent 1:1 classid 1:3 htb rate 89874kbit ceil 89874kbit prio 9
 /sbin/rchtb_tc qdisc add dev eth1 parent 1:3 sfq perturb 10
 # pasmo priorytetowe dla ICMP, TOS 0x10 (min. delay) oraz wybranego portu 22
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:20 htb rate 21kbit ceil 126kbit prio 1 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:20 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 3 parent 1:0 u32 match ip sport 22 0xffff flowid 1:20
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 2 parent 1:0 u32 match ip tos 0x10 0xff flowid 1:20
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 2 parent 1:0 u32 match ip protocol 1 0xff flowid 1:20

# Komputer_szymon 192.168.0.2
 /sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:26 htb rate 21kbit ceil 100kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth1 parent 1:26 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.2 flowid 1:26

# Komputer_tata 192.168.1.4
 /sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:27 htb rate 21kbit ceil 100kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth1 parent 1:27 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.1.4 flowid 1:27

 # Komputer_10
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:21 htb rate 21kbit ceil 126kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:21 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 5 parent 1:0 u32 match ip dst 10.10.10.10 flowid 1:21

 # Komputer_11
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:22 htb rate 21kbit ceil 126kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:22 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 5 parent 1:0 u32 match ip dst 10.10.10.11 flowid 1:22

 # Komputer_2
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:23 htb rate 21kbit ceil 100kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:23 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 5 parent 1:0 u32 match ip dst 10.10.10.2 flowid 1:23

 # Komputer_3
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:24 htb rate 21kbit ceil 100kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:24 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 5 parent 1:0 u32 match ip dst 10.10.10.3 flowid 1:24

 # Komputer_9
 /sbin/rchtb_tc class add dev eth0 parent 1:2 classid 1:25 htb rate 21kbit ceil 100kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev eth0 parent 1:25 sfq perturb 10
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 5 parent 1:0 u32 match ip dst 10.10.10.9 flowid 1:25

 # transfer serwer->LAN
 /sbin/rchtb_tc filter add dev eth0 protocol ip prio 1 parent 1:0 handle 1 fw flowid 1:3

/sbin/rchtb_tc filter add dev eth1 protocol ip prio 1 parent 1:0 handle 1 fw flowid 1:3

 # INTERFEJS PPP0 (ruch wychodzący)
 /sbin/rchtb_tc qdisc add dev ppp0 root handle 2:0 htb default 11 r2q 1

 # główna klasa
 /sbin/rchtb_tc class add dev ppp0 parent 2:0 classid 2:1 htb rate 52kbit ceil 52kbit

 # klasa priorytetowa ACK
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:10 htb rate 6kbit ceil 40kbit prio 1 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:10 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 2 u32 match ip protocol 6 0xff \
  match u8 0x05 0x0f at 0 match u16 0x0000 0xffc0 at 1 match u8 0x10 0xff at 33 flowid 2:10 # ACK

 # klasa priorytetowa TOS 0x10 oraz ICMP
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:9 htb rate 4kbit ceil 40kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:9 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip tos 0x10 0xff flowid 2:9 # TOS 0x10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 2 u32 match ip dport 22 0xffff flowid 2:9 # port 22
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip protocol 1 0xff flowid 2:9 # ICMP


 # Komputer_10
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:12 htb rate 9kbit ceil 47kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:12 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 2 fw flowid 2:12

 # Komputer_11
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:13 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:13 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 3 fw flowid 2:13

 # Komputer_2
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:14 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:14 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 4 fw flowid 2:14

 # Komputer_3
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:15 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:15 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 5 fw flowid 2:15

 # Komputer_9
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:16 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:16 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 6 fw flowid 2:16

# Komputer_szymon
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:17 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:17 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 7 fw flowid 2:17

# Komputer_tata
 /sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:18 htb rate 9kbit ceil 30kbit prio 2 quantum 1500
 /sbin/rchtb_tc qdisc add dev ppp0 parent 2:18 sfq perturb 10
 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 5 handle 8 fw flowid 2:18


 /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 9 u32 match ip dst 0/0 flowid 2:11

# ruch serwerowy (pasmo dla go?ci z zewn?trz)
# /sbin/rchtb_tc class add dev ppp0 parent 2:3 classid 2:11 htb rate 30kbit ceil 35kbit prio 2 quantum 1500
# /sbin/rchtb_tc qdisc add dev ppp0 parent 2:11 sfq perturb 10
# /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 3 handle 1 fw flowid 2:11



}

echo "rc.htb 0.3.3-stable, (C)PriSM 2oo3. Na licencji GNU GPL."
echo "Strona projektu: http://www.rc.htb.prv.pl/"
case "$1" in
 'start')
    echo -n "Uruchamianie kolejkowania..."
    start
    echo " wykonano."
    ;;
 'stop')
    echo -n "Zatrzymywanie kolejkowania..."
    stop
    echo " wykonano."
    ;;
 'restart')
    echo -n "Restartowanie kolejkowania: stop"
    stop
    echo -n " start"
    start
    echo " wykonano."
    ;;
 'status')
    echo "Klasy na interfejsie eth0"
    echo "================================"
    tc class show dev eth0 | grep root
    tc class show dev eth0 | grep -v root | sort | nl
    tc class show dev eth1 | grep root
    tc class show dev eth1 | grep -v root | sort | nl
    echo "Klasy na interfejsie ppp0"
    echo "==================================="
    tc class show dev ppp0 | grep root
    tc class show dev ppp0 | grep -v root | sort | nl
    ;;
 *)
    echo -e "\nUżycie: rc.htb start|stop|restart|status"
    ;;
esac


chyba wszystko

_________________
Obrazek


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: piątek, 18 marca 2005, 02:44 
Offline

Rejestracja: czwartek, 12 lutego 2004, 00:29
Posty: 64
Lokalizacja: Włocławek
czerwo pisze:
wiec tak:
to jest konfiguracja na 3xlan (eth0 eth1 eth2) neo na usb

mam pytanie czy ma ktoś zrobiony knfigurator do 3x lan ?

_________________
bhb


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: piątek, 18 marca 2005, 08:42 
Offline
MODERATOR

Rejestracja: wtorek, 31 sierpnia 2004, 23:06
Posty: 3267
Lokalizacja: Katowice
ale co htb do trzech kart?? ja mam zrobione :) firewalla tez . Firewalla mam z graficznym konfiguratorem a htb trzeba recznie poprawiac :)

_________________
Obrazek


Na górę
 Wyświetl profil  
 
 Tytuł:
Post: piątek, 18 marca 2005, 11:29 
Offline

Rejestracja: czwartek, 12 lutego 2004, 00:29
Posty: 64
Lokalizacja: Włocławek
dzięki tak tylko pytałem :)

_________________
bhb


Na górę
 Wyświetl profil  
 
Wyświetl posty nie starsze niż:  Sortuj wg  
Forum zablokowane Ten temat jest zamknięty. Nie można w nim pisać ani edytować postów.  [ Posty: 6 ] 

Strefa czasowa UTC+2godz.


Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 12 gości


Nie możesz tworzyć nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz dodawać załączników

Szukaj:
Przejdź do:  
cron
Technologię dostarcza phpBB® Forum Software © phpBB Group
Hosting: Compus-Net
RobertKonik.pl