LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-23-2009, 02:53 AM   #1
hadimotamedi
Member
 
Registered: Aug 2009
Posts: 228

Rep: Reputation: 30
Inquiry:How to enable "NAT" on my Linux server?


Dear All
On my Red Hat 7.2 , I installed the Asterisk 1.4.13 and DECT application software and then when I want to try for "NAT" I issue as the followings :
#iptables -t nat -A POSTROUTING -s 10.20.30.0/24 -o eth0 -j MASQUERADE
But it didn't get through . So I checked if the "NAT" is enabled on my Red Hat 7.2 server , as the followings :
#echo "1" > /proc/sys/net/ipv4/ip_forward
But still I cannot try for "NAT" . Can you please let me know which other setings maybe influenced and need to be checked for enabling the "NAT" ?
Thank you in advance
 
Old 11-23-2009, 09:05 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,798

Rep: Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745
Quote:
Originally Posted by hadimotamedi View Post
Dear All
On my Red Hat 7.2 , I installed the Asterisk 1.4.13 and DECT application software and then when I want to try for "NAT" I issue as the followings :
#iptables -t nat -A POSTROUTING -s 10.20.30.0/24 -o eth0 -j MASQUERADE
But it didn't get through . So I checked if the "NAT" is enabled on my Red Hat 7.2 server , as the followings :
#echo "1" > /proc/sys/net/ipv4/ip_forward
But still I cannot try for "NAT" . Can you please let me know which other setings maybe influenced and need to be checked for enabling the "NAT" ?
Thank you in advance
As others have pointed out to you in your past posts, RedHat 7.2 is very, VERY old. There are going to be many things you want to do, but won't be able to do.

That said, there are some IPtables commands that might help:

To show the NAT rules in effect
iptables -nvL -t nat

To Enable SNAT functionality on eth0 (example)
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -o eth0 -j SNAT --to-source x.y.z.c

SNAT (Source NAT) is used to map private source IP numbers of
interfaces on the internal LAN to one of my public static IP numbers.
SNAT performs this mapping when a client running on one of the
internal hosts (x.y.z.c) initiates a TCP connection (SYN) through eth0.

There's lots more on Google for this. And when you post a problem, some actual details would help, instead of saying "it didn't get through". We have no idea what you mean, what it did, or what results you're getting.
 
Old 11-23-2009, 05:11 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,233

Rep: Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708Reputation: 2708
This might be useful http://www.redhat.com/docs/manuals/l...-iptables.html.
However, as pointed out, 7.2 hasn't been updated in years which means terrible security and you won't be able to run modern sw as the compilers & kernels have changed so much. similar issue with modern hw.
I do hope this system is not visible from the internet.
 
Old 11-23-2009, 05:51 PM   #4
landysaccount
Member
 
Registered: Sep 2008
Location: Dominican Republic
Distribution: Debian
Posts: 188

Rep: Reputation: 18
NAT can also be enabled this way:

$iptables -t nat -A POSTROUTING -o $EXT_IFACE -j MASQUERADE


Now, you need to allow ports 5060-5065 and ports in /etc/asterisk/rtp.conf opened both ways (in and out) in order for asterisk to work. Also make sure you have nat=yes in sip.conf.....
 
  


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
Inquiry:What is the equivalent of "ping -f -l" on the Linux server? hadimotamedi Linux - Newbie 3 11-18-2009 05:16 PM
Inquiry:Boot kernel freeze on "Loading jdb module"? hadimotamedi Linux - Newbie 4 11-02-2009 06:25 AM
Inquiry: How to add the "netconf" utility to my Linux server hadimotamedi Linux - Software 4 08-18-2009 02:37 AM
I configure NAT and use "services ..." to save it but when I reboot there is no nat bruack Linux - Software 4 09-01-2004 02:38 AM
Enable TELNET "server" dolvmin Linux - Software 11 09-13-2003 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:54 AM.

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