nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Port forward

This is a discussion on Port forward within the Networking, Firewalls and Security forums, part of the Mastering Servers category; Hello, I have read Linux iptables: Port Redirection Example but I would need some help on port forward. I have: ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Linux answers from nixCraft.


Networking, Firewalls and Security No it's not a secret. Talk about firewalls and security issues.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2010, 04:31 PM
Junior Member
User
 
Join Date: Jul 2008
Location: SM
OS: CentOs
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
cosminnci is on a distinguished road
Post Port forward

Hello,

I have read Linux iptables: Port Redirection Example
but I would need some help on port forward.

I have:

public_ip(eth0) --pc--10.10.10.1(eth1)------10.10.10.2--storage

i need acces from internet to storage on port 80

what I tryed:
iptables -t nat -A PREROUTING -p tcp -i eth0 -d publicip --dport 80 -j DNAT --to 10.10.10.2:80
iptables -A FORWARD -p tcp -d 10.10.10.2 --dport 80 -j ACCEPT
iptables -A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT


but it still does not work
Reply With Quote
  #2 (permalink)  
Old 07-02-2010, 06:49 PM
rockdalinux's Avatar
Is that all you got?
User
 
Join Date: May 2005
Location: Planet Vegeta
OS: Redhat
Posts: 708
Thanks: 15
Thanked 19 Times in 18 Posts
Rep Power: 10
rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light rockdalinux is a glorious beacon of light
Default

Your rules looks ok to me. What about your default polices? Did you see anything in your logs? You also need a POSTROUTING rule to enable masquerading if the redirection goes to another machine.

Code:
iptables -t nat -A POSTROUTING -j MASQUERADE -o ethX
__________________
Rocky Jr.
What's wrong? I hope I am not making you uncomfortable...

Never send a boy to do a mans job.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to forward an email to other account tom Getting started tutorials 4 04-03-2010 10:38 PM
ip forward, ipchain, iptable??? Oppey Linux software 2 24-11-2009 05:15 AM
Forward xferlogs s_anandkumar Linux software 3 22-10-2009 07:32 PM
why can't forward large email attachment? khaosregion Mail Servers 4 25-10-2007 11:49 PM
mail forward between ISPs picioslug Shell scripting 2 23-09-2006 04:53 PM


All times are GMT +5.5. The time now is 07:10 PM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38