Re: Is there an API for ipfw?
- From: Julian Elischer <julian@xxxxxxxxxxxx>
- Date: Thu, 30 Mar 2006 16:40:54 -0800
Mikhail Teterin wrote:
Hi!I use
I'm writing an application that, needs to be able to quickly alter the bandwidth between another machine and the host.
The only way I can do that -- without another machine's cooperation -- is by using the firewall, such as the dummynet functionality of ipfw.
Is there any way to create/alter such a pipe from a C-program without using system("ipfw ....")?
If not ipfw, perhaps, other firewall modules in FreeBSD-6.x?
Thanks a lot!
-mi
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
popen("ipfw -q /dev/stdin", "w");
That way you only run it once and it is always ready
and waiting to get the next command.
The downside is that you need to keep track of what rules you have because if you try delete
a rule that does not exist, then ipfw will quit.
For this reason I put the write() in a loop, that re-opens the pipe if ipfw dies,
and I only try delete rules that I know I put in.
I also made a small change to ipfw (in -current) that makes it not quit
when table entries are added where they already exist and when you try
delete a non existant table entry. (but only in -q mode)
It would be really cool to have an ipfw library that ipfw called and could be imported
into other programs.. (with python, tcl and perl bindings (ok ruby too)).
one for the "ideas" list I guess.
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- References:
- Is there an API for ipfw?
- From: Mikhail Teterin
- Is there an API for ipfw?
- Prev by Date: Re: Is there an API for ipfw?
- Next by Date: Re: Is there an API for ipfw?
- Previous by thread: Re: Is there an API for ipfw?
- Next by thread: Re: Is there an API for ipfw?
- Index(es):
Relevant Pages
- Re: Packet loss with traffic shaper and routing
... ${fwcmd} pipe 1 config bw 512Kbit/s ... ipfw add 1012 skipto 1021
ip from any to 1.1.1.4./30 ... (freebsd-net) - Re: Packet loss with traffic shaper and routing
... ${fwcmd} pipe 1 config bw 512Kbit/s ... ipfw add 1012 skipto 1021
ip from any to 1.1.1.4./30 ... (freebsd-net) - Re: Packet loss with traffic shaper and routing
... ${fwcmd} pipe 1 config bw 512Kbit/s ... what I am saying is that even if we
use skipto rules to create ... ipfw add 1000 skipto 1110 ip from any to 1.1.1.16/28
... (freebsd-net) - Re: Packet loss with traffic shaper and routing
... ${fwcmd} pipe 1 config bw 512Kbit/s ... ipfw add 1012 skipto 1021
ip from any to 1.1.1.4./30 ... (freebsd-net) - FW: [5.2.1-RC, IPFW] Traffic Shaping
... I'm running IPFW on 4.9 and inbound traffic shaping does work, ... ipfw pipe
1 config bw 100Kbit/s ... ipfw add pipe 4 tcp from spock pop3 to any out ...
(freebsd-questions)