Skip to contentSkip to conversation

Filtering packets with U32

LARTC openings 3 participants 3 messages Apr 13, 2003 – Apr 14, 2003

lore
Share & tools
lore

openings

author
#0 lore raw

hi.

I want to filter packets that's source address is 192.168.0.1 or 192.168.0.25 or 192.168.0.0/28.

# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.1 flow id 1:30
# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.25 flow id 1:30
# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.0/28 flow id 1:30

But the above command need to execute tc three times.

Can I filtering it with one line tc command?ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿË™¨¥Šx%ŠË,S ùšŠYšŸ÷lõ¯ç–m§ÿÿ™¨¥™©ÿvÏZþy™¨¥™©ÿ–+-ŠwèþV«µÁÎY3ÿ†Ûiÿÿåj»\þŠà

#1 lore raw
Quoted 5 lines · openings

hi.

I want to filter packets that's source address is 192.168.0.1 or 192.168.0.25 or 192.168.0.0/28.

Quoted 8 lines
# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src
192.168.0.1 flow id 1:30 # tc filter add dev eth0 parent 1: protocol ip
prio 1 u32 match ip src 192.168.0.25 flow id 1:30 # tc filter add dev eth0
parent 1: protocol ip prio 1 u32 match ip src 192.168.0.0/28 flow id 1:30

But the above command need to execute tc three times.

Can I filtering it with one line tc command?

No.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to openings
Quoted 11 lines · openings

hi.

I want to filter packets that's source address is 192.168.0.1 or 192.168.0.25 or 192.168.0.0/28.

# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.1 flow id 1:30
# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.25 flow id 1:30
# tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip src 192.168.0.0/28 flow id 1:30

But the above command need to execute tc three times.

Can I filtering it with one line tc command?

You can try -batch switch. It takes a file to pasrse and run commands from there. So, you can run once tc command...

---
Catalin(ux) BOIE
[email protected]
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/