LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-25-2011, 06:17 PM   #1
williamcsc
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
ip route and route command with a little port forwarding


Hello everyone, i have desided to convert my server to ubuntu server. For years i have been running opensuse but I like the fact that ubuntu tends to work better with vbox and it pretty universal, but it has given me a lot of snags and I have been logged in ssh for over a day try to get it to behave the way I'd like. I have the internet coming in on a static ip (eth1)"74.*.*.*" and need to route it to a static network of (eth0)192.*.*.*. I do not want dchp I configured the network manually and the internal networks well as the internet connection. example is i can log in the main server with ssh and log into a box behind the server with ssh subnet gateway ips dns are all configured right but I can't get this box to route and port forward to a box inside.
any help with how I'd do this with the ip route or route command would be appreciated.
Goal
route 74.*.*.* on eth1 to 192.*.*.* to eth0/ port 8000 to 80 0n a internal box.
Thank you to anyone who responds I have been all over the internet and i have not found a explanation that didn't make it more confusing.

Last edited by williamcsc; 12-25-2011 at 07:43 PM.
 
Old 12-25-2011, 08:53 PM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
What you are looking for is NAT.

In this example, it needs to be done BEFORE routing happens.

Route doesnt do NAT'ing, use whatever firewall you have running on your gateway to do it.
 
Old 12-25-2011, 09:16 PM   #3
williamcsc
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Sorry

Quote:
Originally Posted by fukawi1 View Post
What you are looking for is NAT.

In this example, it needs to be done BEFORE routing happens.

Route doesnt do NAT'ing, use whatever firewall you have running on your gateway to do it.
#############################################
Sorry if I was unclear or used the terms incorrectly, Yes I would like to set up my ubuntu box as a router that uses NAT. By definition Nat is "In computer networking, network address translation (NAT) is the process of modifying IP address information in IP packet headers while in transit across a traffic routing device." --http://en.wikipedia.org/wiki/Network_address_translation. So my server is the routing device sorry I was unclear but I didn't think to state that because the ip ranges are different making it noticeable that the networks are not bridged are not on the same network and use a private ip range starting with 192 used my Microsoft Windows ICS and most companies the produce routing devices the Have firewall, nat and a cute built in switch linksys,breklin...I never used ubuntu(or any debian based distros) in this way and was wondering if someone could help me with the configuration with the firewall in terms port forwarding, and Network Address Translation(NAT). So If i log in elevate my privileges can someone help me with configuring it? Who knows? I mean has a real answer?
Thank You to anyone that responds.
 
Old 12-25-2011, 09:32 PM   #4
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
People cant help, if you dont ask the right questions.

iptables is the most common firewall/NAT application out of the box with linux distrobutions. Debian based distro's included.

The link below sounds like it would be of benefit to you.
http://www.linuxhomenetworking.com/w...s#Introduction

You will probably want a rule, similar to.
Code:
-t nat -A PREROUTING -i $WANIF -p tcp --dport 8000 -j DNAT --to-destination $INT_IP:80
(as indicated by your "goal" although earlier in the post you mention ssh, which shouldn't be running on port 80)
 
Old 12-25-2011, 09:36 PM   #5
williamcsc
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
thanks but I have to say...
Quote:
Originally Posted by fukawi1 View Post
What you are looking for is NAT.

In this example, it needs to be done BEFORE routing happens.

Route doesnt do NAT'ing, use whatever firewall you have running on your gateway to do it.
fukawil about your "ASCII stupid question, get a stupid ANSI", ignorance is not the same as stupidity, the only time ignorance is the same as stupidity is when the ignorant person thinks they are so smart to be rude to someone else and show there ignorance with confidence that they know the true answer when they don't. You didn't give one answer, someone who knew the answer would probably say i think you miss typed your question but I think this is what you meant here is what i think. Oh sorry you gave 1/8 of one.
thanks for the link I have been trying to get down the ufw I'll find out somewhere else.

PS(as indicated by your "goal" although earlier in the post you mention ssh, which shouldn't be running on port 80) ssh runs on port 22 I am forwarding to apache2 and ssh example was to show that the internal network is functional to narrow down where the problems"
Here's one for you, sence your so in to ascii "1010101101000010000010110011001111101010110100101010011" It's binary I'm not sure it might mean something

Last edited by williamcsc; 12-25-2011 at 09:57 PM.
 
  


Reply



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
Route eth2 TCP packets to tun0 with IPTABLES & IP RULE/ROUTE Thireus Linux - Networking 4 05-09-2011 12:38 PM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
IP Route Add or Forwarding ? k.king Linux - Networking 2 11-25-2005 02:32 PM
keepalived keeps using route not masq as the forwarding method. abefroman Linux - Networking 0 09-05-2005 04:21 PM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:11 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