git init --bare
#!/bin/bash
tc qdisc add dev eth2 root handle 1: htb default 10 #Корневая дисциплина, с указание класса по умолчания не
попавшего ни под один фильтр
tc class add dev eth2 parent 1: classid 1:1 htb rate 4096kbit #Корневой класс отвечающий за общую пропускную
cпособность
tc class add dev eth2 parent 1:1 classid 1:10 htb rate 64kbit ceil 150kbit prio 7 #класс с наименьшим приоритетом
tc qdisc add dev eth2 parent 1:10 handle 10: sfq perturb 10
#Фильтр по IP добавить
tc filter add dev eth2 parent 1:0 prio 1 protocol ip u32 match ip dst 192.168.0.5 classid 1:10
tc filter add dev eth2 parent 1:0 prio 2 protocol ip u32 match ip dst 192.168.0.15 classid 1:10
########################################################################
tc class add dev eth2 parent 1:1 classid 1:2 htb rate 200kbit ceil 400kbit prio 2
tc qdisc add dev eth2 parent 1:2 handle 2: sfq perturb 10
#Фильтр по IP добавить
tc filter add dev eth2 parent 1:0 prio 3 protocol ip u32 match ip dst 192.168.0.10 classid 1:2
tc filter add dev eth2 parent 1:0 prio 4 protocol ip u32 match ip dst 192.168.0.11 classid 1:2
tc filter add dev eth2 parent 1:0 prio 5 protocol ip u32 match ip dst 192.168.0.21 classid 1:2
########################################################################
tc class add dev eth2 parent 1:1 classid 1:3 htb rate 184kbit ceil 450kbit prio 3
tc qdisc add dev eth2 parent 1:3 handle 3: sfq perturb 10
#Фильтр по IP добавить
tc filter add dev eth2 parent 1:0 prio 8 protocol ip u32 match ip dst 192.168.0.41 classid 1:3
tc filter add dev eth2 parent 1:0 prio 6 protocol ip u32 match ip dst 192.168.0.28 classid 1:3
tc filter add dev eth2 parent 1:0 prio 8 protocol ip u32 match ip dst 192.168.0.202 classid 1:3
tc filter add dev eth2 parent 1:0 prio 9 protocol ip u32 match ip dst 10.10.10.10 classid 1:3
########################################################################
tc class add dev eth2 parent 1:1 classid 1:4 htb rate 64kbit ceil 256kbit prio 4
tc qdisc add dev eth2 parent 1:4 handle 4: sfq perturb 10
#Фильтр по IP добавить
tc filter add dev eth2 parent 1:0 prio 10 protocol ip u32 match ip dst 192.168.0.22 classid 1:4
tc filter add dev eth2 parent 1:0 prio 11 protocol ip u32 match ip dst 192.168.0.27 classid 1:4
tc filter add dev eth2 parent 1:0 prio 12 protocol ip u32 match ip dst 192.168.0.203 classid 1:4
[root@OracleLinux ~]# cat /etc/xen/xend-config.sxp | grep vif-script (vif-script vif-bridge) #(vif-script vif-route) #(vif-script vif-nat) [root@OracleLinux ~]# cat /etc/xen/xend-config.sxp | grep network-script # (network-script network-bridge) #(network-script network-xen-multi-bridge) (network-script 'network-bridge netdev=eth2') # (network-script 'network-bridge bridge=<name>') #(network-script network-bridge) # (network-script 'network-bridge bridge=<name>') then you may wish to do the #(network-script network-route) #(network-script network-nat)
[root@OracleLinux ~]# cat /etc/xen/Ubuntu_squid_sams name = "Ubuntu_squid_sams" uuid = "7cc14ee2-5be9-b5ad-ce3f-f3d01f821a09" maxmem = 256 memory = 256 vcpus = 1 builder = "hvm" kernel = "/usr/lib/xen/boot/hvmloader" boot = "c" pae = 1 acpi = 1 apic = 1 localtime = 0 on_poweroff = "destroy" on_reboot = "restart" on_crash = "restart" device_model = "/usr/lib64/xen/bin/qemu-dm" sdl = 0 vnc = 1 vncunused = 1 keymap = "ru" disk = [ "phy:/dev/sda9,hda,w", ",hdc:cdrom,r" ] vif = [ "mac=00:16:36:2f:26:7a,bridge=virbr0,script=vif-bridge", "mac=00:16:36:3b:21:97,bridge=xenbr0,script=vif-bridge" ] parallel = "none" serial = "pty" extra = "xencons=pty"