You are not logged in.

#1 2006-12-06 16:23:02

DarkPath
Member
Registered: 2004-11-15
Posts: 50

Packet forwarding question

Ok, after looking over a bunch of webpages and documentation, I still don't have a solid answer for what I'm trying to do with iptables. I'm hoping some iptables guru here on the Arch boards can help me out. wink

What I'm trying to do is setup a laptop of mine to forward packets. I need to be able to do something like "if you receive a packet from IP X, send it to IP Y" and, for returning packets, "if you receiving a packet from IP Y, send it to IP X." From what I've been able to tell, I should be able to do this with iptables, but I'm not sure what rules I should apply...

Also, if someone has another suggestion to forward packets like this, I'd love to hear it.

Offline

#2 2006-12-10 15:08:19

F
Member
Registered: 2006-10-09
Posts: 322

Re: Packet forwarding question

# echo 1 > /proc/sys/net/ipv4/ip_forward

This doesn't answer your question, but is very necessary for you to do anyways.

Offline

#3 2006-12-10 21:08:17

jerem
Member
From: France
Registered: 2005-01-15
Posts: 310

Re: Packet forwarding question

To make the changes permanent, edit /etc/conf.d/iptables.

To restrict forwarding to the ip addresses X and Y, use this :

iptables -P FORWARD DROP
iptables -A FORWARD -s X -d Y -j ACCEPT
iptables -A FORWARD -s Y -d X -j ACCEPT
/etc/rc.d/iptables save

Add iptables to the daemons array in /etc/rc.conf.

Offline

Board footer

Powered by FluxBB