Skip to contentSkip to conversation

Traffic shaping PPPoe encapsulated packet

LARTC Samit 2 participants 3 messages Aug 26, 2007 – Aug 28, 2007

lore
Share & tools
lore
#1 lore raw
Quoted 4 lines · Samit

Hi,

I want a way to traffic shape pppoe encapsulated pkts based on its src/dst Ip address. Is there any way I can mark pppoe encapsulated pkts?

I don't know what you can do with iptables now it's X tables.

If you have the ppp interface on the shaping/netfilter box then you will see ip from/to it anyway.

If the pppoe is just passing through then you should be able to make a u32 filter to match parts of the packet. Use tcpdump -e to see the ethertype protocol number for pppoe data frames and make a filter to match that number, then I guess the IP part will be at an offset of 8 more than the normal offsets. You will need to use u32 to match the src/dst addresses in hex. I have never done it, but it should be possible.

tc filter add dev $DEV protocol $PPPOE prio 1 u32 match u32 0xc0a80001 0xffffffff at 20 flowid ....

should match src 192.168.0.1 use "at 24" for dst.

Andy
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

author
#2 lore raw

Re: [LARTC] Traffic shaping PPPoe encapsulated packet [SOLVED]

In reply to Samit

Thanks..it worked.. :)

/sbin/tc filter add dev eth1 protocol 0x8864 parent 2:0 prio 1 u32 \
match u32 0x$IPREMOTE_HEX 0xffffffff at 24 flowid 2:$ID

Now I don't have to shape the dst traffic on each ppp interface.

Regards,
Samit

Quoted 18 lines · Andy Furniss
Quoted 4 lines · Samit

Hi,

I want a way to traffic shape pppoe encapsulated pkts based on its src/dst Ip address. Is there any way I can mark pppoe encapsulated pkts?

I don't know what you can do with iptables now it's X tables.

If you have the ppp interface on the shaping/netfilter box then you will see ip from/to it anyway.

If the pppoe is just passing through then you should be able to make a u32 filter to match parts of the packet. Use tcpdump -e to see the ethertype protocol number for pppoe data frames and make a filter to match that number, then I guess the IP part will be at an offset of 8 more than the normal offsets. You will need to use u32 to match the src/dst addresses in hex. I have never done it, but it should be possible.

Quoted 8 lines

tc filter add dev $DEV protocol $PPPOE prio 1 u32 match u32 0xc0a80001 0xffffffff at 20 flowid ....

should match src 192.168.0.1 use "at 24" for dst.

Andy

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc