LinuxQuestions.org
Help answer threads with 0 replies.
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 09-05-2006, 05:43 AM   #1
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Rep: Reputation: 15
Port Forwarding.


Hi do any of you know any good Linux Red Hat Enterprise Version 4 Port Forwarding programs? It's just i can't port forward on my Linux PC It says, " NAPT server IP address is not a valid host LAN address."
When i enter 192.168.0.93 as the address. So could any of you help me?

Thank you
sseeker
 
Old 09-05-2006, 06:01 AM   #2
nmn
LQ Newbie
 
Registered: Aug 2006
Posts: 24

Rep: Reputation: 15
Let me explain.

Port forwarding is almost always done at a router level.
I can log into my router (at 192.168.0.1 from my own network) and change the settings so ports * though * are directly open to my computer. All routers are different but for whatever your doing theres prolly a guide and theres usually a generic guide too.

I was trying to get on to my internet yesterday and it refused to work, and one of my problems could have been from my router cuz i could still logon to it. it was having trouble after i had to quit out of the SuSE 10.0 installer early(I was reinstalling after ruining X again ) and internet was setup wrong. I eventually rebooted back into setup, finished and found that it didnt work... internet wasnt working. So i worked on it for two days and yesterday, being the working guy i am i stopped. I did get somewhere, i found out it was working but couldn't resolve hostnames because it was trying to do it in the loopback device... So what did i do to fix it? Well, i had a copy of visual boy advanced for windows with link support... So, me my brother and a couple friends tried to vba link and play Kirby.... It was actually more fun than i thought. Well, anyways i found my probs in the hostname section of YaST, not my router. But it very well could have been. Just make sure to have some friends on the same network and vba link handy if you cant get the internet working but you can get networking working lol.

So google on a guide for your router. Youll find one, i hope.
 
Old 09-05-2006, 06:12 AM   #3
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
Ummm, Ok..... Was that ment to help :P Since my hostnames are fine. =/
 
Old 09-05-2006, 07:17 AM   #4
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
What is that you want to forward?
Can you tell the requirement a bit more clear?

There are a few software tools you can check out for linux routing

1. iptables - For static routing, ip forwarding , etc
2. zebra - dynamic routing ,etc.

Zulfi.A
 
Old 09-05-2006, 08:30 AM   #5
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks. I'm trying to forward a webserver, MySQL Server and Mail Server just need to find out how to do it.

P.S
Why do they all have to be .tar.gz?!?!? I always get compiling errors!

Last edited by sseeker; 09-05-2006 at 08:43 AM.
 
Old 09-05-2006, 08:42 AM   #6
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
http://www.tldp.org/HOWTO/IP-Masquer...orwarders.html ?

Google turned up that on "port forwarding with iptables"

Should be of some use.

Seems a bit old (a few mentions of 2.2 kernel) but it does have annotations mentioning 2.4/2/6 kernels.
 
Old 09-05-2006, 08:51 AM   #7
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
Thanks. That mioght help. Just MY RHEV4 doesn't have some stuff so sometimes it doesn't work.
 
Old 09-05-2006, 09:30 AM   #8
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
Hooray it's installed now how do i port forward from it? Lol.
 
Old 09-05-2006, 03:06 PM   #9
nmn
LQ Newbie
 
Registered: Aug 2006
Posts: 24

Rep: Reputation: 15
Unless im missing something, i think your talking about forwarding your ports to make it so you have direct access from your router. Ive never heard of anything else, so i told you what i knew. I was just talking about something else on the side, probably cuz i was freaking tired as hell. Well, i said to google for a guide onto your router.. but looking back, it looks like you meant something else.

Sorry, im a n00b.

Oh, and as for what your talking about now... Try using the console with the IPPORTFW, IPAUTOFW, REDIR, and UDPRED commands. So now im curious of what your doing, so im going to have to see exactly what it means. Ive never heard of this. Hope you can find a solution.
 
Old 09-06-2006, 02:33 AM   #10
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
None of those commands work. I'm just trying to forward my ports to my Linux servers IP (192.168.0.93)
 
Old 09-06-2006, 02:42 AM   #11
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport ports -j DNAT --to 192.168.0.93

This is one example of a port forward using IPtables.


Check this link out fully and hope it helps


http://www.netfilter.org/documentati...-HOWTO-10.html
 
Old 09-06-2006, 02:52 AM   #12
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
When i try the command witch is on that page i get
Bad argument ` -p'
Try `iptables -h' or 'iptables --help' for more information.


Whats this?

But when i try the command you did (replacing the X.X.X.X) it just went on to a new [root@mshome ~]# line :S Did it work?

Last edited by sseeker; 09-06-2006 at 02:58 AM.
 
Old 09-06-2006, 03:01 AM   #13
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
You would have typed the command wrong.There should be a proper IPaddress from where you want to forward before '-p' .

Also you check 'iptables -h' and check the syntax [-p for protocol].

Also if you keep getting errors paste the exact command you tried.
 
Old 09-06-2006, 03:05 AM   #14
sseeker
Member
 
Registered: Aug 2006
Distribution: CentOS 5
Posts: 48

Original Poster
Rep: Reputation: 15
I know i did. I typed the command and replaced the X.X.X.X with my WAN IP and the ports with my port and it just went on a new line.
[root@mshome ~]# iptables -t nat -A PREROUTING -d 124.178.121.111 -p tcp --dport 80 -j DNAT --to 192.168.0.93
[root@mshome ~]#

Thats all that happend.

But did it work?

Heres the link: http://124.178.121.111

P.S What about this command: iptables -t nat -A PREROUTING -i internal_eth -d external_ip -p tcp --dport 80 -j DNAT --to-destination=192.168.0.93
?

Last edited by sseeker; 09-06-2006 at 03:12 AM.
 
Old 09-06-2006, 03:14 AM   #15
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Yes it has got added to iptables rules.

Check the rules using the command

iptables --list
- Will show INPUT,OUTPUT and FORWARD Rules

iptables -t nat --list
- Will show all NAT rules.


The link will have all the information.
Check the link before you try anything.
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
Port 80 forwarding to port 22 with iptables zahoo Linux - Networking 3 02-22-2005 07:22 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 10:37 AM
Port Forwarding.. Thom_Redhat Linux - Networking 3 05-16-2003 05:02 PM


All times are GMT -5. The time now is 03:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration