LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-21-2013, 06:45 AM   #1
Gil@LQ
Member
 
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273

Rep: Reputation: 1
NAT without enabling MASQUERADE


hi all,

I'm running centos6.3, which acts as gateway and firewall. I configured nat on it for remote desktops and jabber server to access from out side works perfect.
Quote:
Problem was if i remove MASQUERADE then nat is not working, if i set MASQUERADE to ACCEPT any one can configrure server ip as gateway and can use internet isn't it?
Please help me get the nat working without enabling MASQUERADE.

thank you in advance.
 
Old 08-21-2013, 10:51 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You don't provide enough information to give you a detailed answer. Masquerade is a form of NAT: it automatically translates traffic from one range to another and handles the return traffic. For example, a common use of masquerade is in sharing your wired internet (default gateway) connection with wireless devices. You can configure your wired range to use for example, 192.168.x.x and your wireless to use 10.10.y.y. and set the wireless IP address as the gateway for wireless devices. The use of masquerade will then automatically translate addresses on the wireless 10. range to 192.168 addresses and vice versa.

When you say you want to use NAT without masquerade you need to develop rules to allow your traffic and the return traffic. If you are having problems with your NAT rules, I would suggest posting your rules along with a description of exactly what you're trying to accomplish.

Also, in case you haven't already, it is usually necessary to set ip forwarding to 1 in order to allow traffic to bridge the ranges.
 
Old 08-21-2013, 12:45 PM   #3
Gil@LQ
Member
 
Registered: Apr 2010
Location: India /Hyderabad
Distribution: RedHat, CentOS
Posts: 273

Original Poster
Rep: Reputation: 1
Hi Noway2,

Thanks for your reply, sorry i couldn't give you more information. here are my rules, nat works for RDP,JABBER but at the same time MASQUERADE is enabled so that any user in the lan who is good enough to configure this firewall ip as his gateway and can use internet and do as he wish. In that case if i disable masquerade i'm unable to connect rdp from internet which means nat doen't work.

Quote:
:OUTPUT ACCEPT [38:2437]
-A PREROUTING -p tcp -m tcp --dport 110 -j DNAT --to-destination 192.168.80.110:3389
-A PREROUTING -p tcp -m tcp --dport 5222 -j DNAT --to-destination 192.168.80.3:5222
-A PREROUTING -p tcp -m tcp --dport 10 -j DNAT --to-destination 192.168.80.10:3389
-A POSTROUTING -j MASQUERADE
COMMIT
# Completed on Wed Aug 21 18:20:01 2013
# Generated by iptables-save v1.4.7 on Wed Aug 21 18:20:01 2013
*filter
:INPUT ACCEPT [6876:2273997]
:FORWARD ACCEPT [13640:20222679]
:OUTPUT ACCEPT [5527:8428949]
COMMIT
# Completed on Wed Aug 21 18:20:01 2013
Please help me resolve the issue.

Thank you very much in advance.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Masquerade and nat seeklinux Linux - Newbie 10 07-31-2013 02:13 AM
routing / IP masquerade / NAT question stu_c Slackware 9 05-17-2011 03:55 PM
NAT with MASQUERADE only for eth2 ? czezz Linux - Networking 1 06-16-2010 11:08 AM
NAT/Masquerade not working? eswenson Linux - Networking 3 06-04-2010 02:08 PM
iptables - true nat AND masquerade rebuke Linux - Security 3 11-11-2003 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration