Re: tcng ingress examples

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Hi,

> I'am looking for tcng examples where ingress is used.
> Please post me some (working) examples, no need for explanation.

> Thank you
> Alex

Here is an example of ingress policing.
I haven't tested this script under Linux.
- Jacob

dev "s0e0" {
    ingress {
	$from_c1_net = ip_src:24 == 10.10.1.0;
	$c1_ssh_cir = 20Mbps;
	$c1_ssh_pir = 30Mbps;
	$c1_http_cir = 120Mbps;
	$c1_http_pir = 200Mbps;
	$c1_other_cir = 60Mbps;
	$c1_other_pir = 100Mbps;

	$from_c1_ssh = $from_c1_net && tcp_sport == PORT_SSH;
	$c1_ssh_pol = DLB(cir $c1_ssh_cir,cbs 20kB,pir $c1_ssh_pir,pbs 5kB);

	class (<>)
	    if $from_c1_ssh && DLB_ok($c1_ssh_pol);
	drop if $from_c1_ssh;

	$from_c1_http = $from_c1_net && tcp_sport == PORT_HTTP;
	$c1_http_pol = DLB(cir $c1_http_cir,cbs 50kB,pir $c1_http_pir,pbs 20kB);

	class (<>)
	    if $from_c1_http && DLB_ok($c1_http_pol);
	drop if $from_c1_http;

	$from_c1_other = $from_c1_net;
	$c1_other_pol =
	  DLB(cir $c1_other_cir,cbs 30kB,pir $c1_other_pir,pbs 20kB);

	class (<>)
	    if $from_c1_other && DLB_ok($c1_other_pol);
	drop if $from_c1_other;

	/*
	 * Second customer, etc.
	 */

	class (<>) if 1;
    }
}
_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux