Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables
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
Furtim
n00b
n00b


Joined: 01 Dec 2002
Posts: 65

PostPosted: Wed May 14, 2003 9:02 am    Post subject: iptables Reply with quote

Hope you can helip
I have a setup = internet <---- firewall <---- switch <---- lan
Firewall = external ip (dhcp) Lan = static ip's (c class network)
Firewall works every workstation can browse the internet.
Now I need to have one workstation to have connections comming in from the internet (active not passive) bypassing the firewall for a few ports while still protecting the rest of the lan from the outside. Tried to get my head round this problem but i'm stuck.
Thx
Back to top
View user's profile Send private message
kopfarzt
Apprentice
Apprentice


Joined: 05 Apr 2003
Posts: 170
Location: Vienna, Austria

PostPosted: Wed May 14, 2003 11:44 am    Post subject: Reply with quote

What you want to do is called port-forwarding. Try something like this:
Code:

iptables -t nat -A PREROUTING -i iii -p tcp -d a.b.c.d --dport pppp -j DNAT --to e.f.g.h


where iii is your external interface (like eth0) a.b.c.d is your external address, pppp is the port you want to forward, eth0 is the external interface and e.f.g.h is the address of your internal workstation. Of course your firewall should not block that traffic anywhere else :-)

kopfarzt
Back to top
View user's profile Send private message
Furtim
n00b
n00b


Joined: 01 Dec 2002
Posts: 65

PostPosted: Wed May 14, 2003 12:08 pm    Post subject: Reply with quote

Thanks for the reply
Have already tried all port_forward rules and still no go
Just installed a firewall script rc.firewall from http://projectfiles.com/firewall/ and that will not let me achive what I want. So I must be missing the point some where.
I think I will have to review the whole firewall ( iptables ) problem again from scratch. (great fun) :)
If you have any sugestion it is most welcome.
Thx
Back to top
View user's profile Send private message
joycea
Apprentice
Apprentice


Joined: 23 Jul 2002
Posts: 191
Location: Kingston, Canada

PostPosted: Wed May 14, 2003 12:30 pm    Post subject: Reply with quote

Take a look at this script,
https://forums.gentoo.org/viewtopic.php?t=50715

This is something I wrote to turn on and off port-forwarding on my firewall. Maybe it will solve your problems too. Also, there is a small app called redirector listed on that topic. It also works well and might be suitable for your situation.
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