Realtel Gigabit [re(4)] , altq enable patch

Chris Dionissopoulos dionch at freemail.gr
Fri Feb 4 06:19:41 PST 2005


This is an untested patch which (IMHO) enables altq 
processing for  netgraph  virtual ethernet interfaces (ng_eiface(4)).

HOWTO use/test ng_eiface with pf+altq 
~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Patch and compile ng_eiface module.
2. Create a ngeth0 virtual ethernet interface, attached to
a ng_bridge with a physical interface. i.e. (re0 = physical):
---init---
#/sbin/kldload ng_eiface.ko
#/sbin/kldload ng_ether.ko
#/sbin/kldload ng_bridge.ko
#/sbin/ifconfig re0 delete
---create bridge---
#/usr/sbin/ngctl mkpeer re0: bridge lower link0
#/usr/sbin/ngctl name re0:lower bridge0 
#/usr/sbin/ngctl name re0: setpromisc 1
#/usr/sbin/ngctl name re0: setautosrc 0
#/usr/sbin/ngctl connect re0: bridge0 upper link1
---create virtual+connect to bridge----
#/usr/sbin/ngctl mkpeer . eiface hook ether
#/usr/sbin/ngctl connect ngeth0: bridge0: lower link2
#/usr/sbin/ngctl connect ngeth0: bridge0: upper link3
#/usr/sbin/ngctl name ngeth0: setautosrc 1
#/usr/sbin/ngctl name ngeth0: setpromisc0
---config virtual-----
#/sbin/ifconfig ngeth0 link xx:xx:xx:xx:xx:xx
#/sbin/ifconfig ngeth0 yy.yy.yy.yy/zz up


3. Create and load a queue definition which involves ngeth0 interface.
For example; pf.conf:
altq on ngeth0 cbq bandwidth 10Mb queue {vlan}
queue vlan bandwidth 80% cbq(default) {vlan_in vlan_out}
queue vlan_in bandwidth 10% cbq(borrow)
queue vlan_out bandwidth 10% cbq(borrow)

loads these rules:  (pfctl -sq)
queue root_ngeth0 bandwidth 10Mb priority 0 cbq( wrr root ) {vlan}
queue  vlan bandwidth 8Mb cbq( default ) {vlan_in, vlan_out}
queue   vlan_in bandwidth 800Kb cbq( borrow )
queue   vlan_out bandwidth 800Kb cbq( borrow )

4. Create some pf-rules to queue your traffic and test.
(i.e. pass out on ngeth0 ip from any to any queue vlan_out)

Please send me your comments/tests.

Chris.



____________________________________________________________________
http://www.freemail.gr - δωρεάν υπηρεσία ηλεκτρονικού ταχυδρομείου.
http://www.freemail.gr - free email service for the Greek-speaking.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ng_eiface_altq.patch
Type: application/octet-stream
Size: 630 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-pf/attachments/20050204/ab4578cf/ng_eiface_altq.obj


More information about the freebsd-pf mailing list