Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
intercet IP packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jkriger
Tux's lil' helper
Tux's lil' helper


Joined: 03 Oct 2003
Posts: 85
Location: Buenos Aires, Argentina

PostPosted: Thu Dec 16, 2004 1:56 pm    Post subject: intercet IP packages Reply with quote

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
View user's profile Send private message
expat_iain
Guru
Guru


Joined: 09 Jan 2004
Posts: 361
Location: Malta GC

PostPosted: Thu Dec 16, 2004 4:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum