View previous topic :: View next topic |
Author |
Message |
jkriger Tux's lil' helper
Joined: 03 Oct 2003 Posts: 85 Location: Buenos Aires, Argentina
|
Posted: Thu Dec 16, 2004 1:56 pm Post subject: intercet IP packages |
|
|
Hi all!
I would to make an application like netfilter. I mean, I would to intercet IP packages send to port number X and forward them port Y without changing the IP package. The idea is to shape the IP traffic.
The problem is that I don't know to intercet IP packages. Don't know which kernel function call to make this.
Does anyone know how can I do this?
Cheers! |
|
Back to top |
|
|
expat_iain Guru
Joined: 09 Jan 2004 Posts: 361 Location: Malta GC
|
Posted: Thu Dec 16, 2004 4:16 pm Post subject: |
|
|
Port forwarding can be done by netfilter. You need to use the NAT functionality.
Code: | iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to-destination 10.10.10.10:80
iptables -A FORWARD -d 10.10.10.10 -p tcp --dport 80 -j ACCEPT |
Regs.
Iain. |
|
Back to top |
|
|
|