Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
documentation:infrastructure:exemple_sames [2011/07/16 19:15] 80.67.166.130 [Présentation infrastructure] |
documentation:infrastructure:exemple_sames [2012/09/17 08:15] (Version actuelle) |
||
---|---|---|---|
Ligne 251: | Ligne 251: | ||
- | < | + | < |
+ | noipdefault | ||
defaultroute | defaultroute | ||
Ligne 275: | Ligne 276: | ||
- | //alix:~# cat / | + | //alix:~# cat / |
+ | < | ||
+ | #!/bin/sh | ||
+ | PATH=/ | ||
- | < | + | WAN=WAN1 |
+ | NETW=80.68.167.128 | ||
+ | MAXUP0=700 | ||
+ | MAXUP1=600 | ||
+ | |||
+ | if [ " | ||
+ | WAN=WAN1 | ||
+ | NETW=80.68.167.128 | ||
+ | elif [ " | ||
+ | WAN=WAN2 | ||
+ | NETW=80.68.167.160 | ||
+ | elif [ " | ||
+ | WAN=WAN3 | ||
+ | NETW=80.68.167.192 | ||
+ | elif [ " | ||
+ | WAN=WAN4 | ||
+ | NETW=80.68.167.224 | ||
+ | fi | ||
+ | |||
+ | ip route add $PPP_REMOTE dev $PPP_IFACE proto kernel scope link src $PPP_LOCAL table $WAN | ||
+ | ip route add default dev $PPP_IFACE scope link table $WAN | ||
+ | |||
+ | tc qdisc del dev $PPP_IFACE root handle 1: htb | ||
+ | |||
+ | tc qdisc add dev $PPP_IFACE root handle 1: htb default 100 | ||
+ | tc class add dev $PPP_IFACE parent 1: classid 1:1 htb rate 100000Kbit ceil 100000Kbit burst 1023975b cburst 126575b prio 0 quantum 60000 | ||
+ | tc class add dev $PPP_IFACE parent 1:1 classid 1:2 htb rate 800kbit ceil 800kbit burst 6Kb cburst 2224b quantum 60000 | ||
+ | |||
+ | tc class add dev $PPP_IFACE parent 1:2 classid 1:10 htb rate 500kbit ceil ${MAXUP0}kbit burst 48Kb prio 1 quantum 60000 | ||
+ | tc qdisc add dev $PPP_IFACE parent 1:10 handle 10: sfq perturb 10 | ||
+ | |||
+ | tc class add dev $PPP_IFACE parent 1:2 classid 1:3 htb rate 200kbit ceil ${MAXUP0}kbit burst 24Kb prio 2 quantum 60000 | ||
+ | |||
+ | tc class add dev $PPP_IFACE parent 1:3 classid 1:100 htb rate 100kbit ceil ${MAXUP1}kbit burst 24Kb prio 3 quantum 60000 | ||
+ | tc qdisc add dev $PPP_IFACE parent 1:100 handle 100: sfq perturb 10 | ||
+ | |||
+ | tc qdisc del dev $PPP_IFACE ingress | ||
+ | tc qdisc add dev $PPP_IFACE handle ffff: ingress | ||
+ | tc filter replace dev $PPP_IFACE parent ffff: protocol ip prio 50 u32 match ip src 0.0.0.0/0 police rate 10000kbit burst 500k drop flowid :1 | ||
+ | |||
+ | tc filter add dev $PPP_IFACE parent 1:0 protocol ip prio 1 handle 0x01/0xF fw flowid 1:10 | ||
+ | |||
+ | ip rule del from 80.68.167.128/ | ||
+ | ip rule del from 80.68.167.160/ | ||
+ | ip rule del from 80.68.167.192/ | ||
+ | ip rule del from 80.68.167.224/ | ||
+ | |||
+ | ip rule add from $NETW/27 table $WAN | ||
</ | </ | ||