LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 10-24-2003, 12:16 AM   #1
Kumado
Member
 
Registered: Oct 2003
Location: Ohio , USA
Distribution: up to Suse 13.1
Posts: 71

Rep: Reputation: 25
Nat to Webserver routing


Hi, I am new to Linux as well as networking.

I use Suse 8.2. I am a teacher and do more and more withtthe networking at the buildings. I have a working Linux NAT box and a Win2K server inside the LAN for DHCP and other Windows related needs. I have a Web server running inside the LAN as well ( I was told this is safer and it would make it easier to put live camera images on a web page too ) It is also Suse 8.2 with Apache.

I have 3 Live IPs available to me to use.

I am wanting to know how to set traffic from the second IP ( and later the third ) thru the NAT to the Web server.

Do I need to set up eth0:0?

How do you get that traffic directed to a second box that is the webserver?

Thanks in advance for any help!
 
Old 10-24-2003, 08:57 AM   #2
pansophic
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
Are you sure that you want to run second web server? You can run virtual servers on the same computer using a single IP address. In Apache, you do this by configuring Virtual Hosts.

Take a look at:

httpd.apache.org/docs-2.0/vhosts/

If you still want add the second server, you can do it by forwarding port 80 on one of your available IP addresses to the IP of the second server. I am assuming that you have already configured NAT and port forwarding on your Internet box.

I am not sure what utility you use in SuSE to add a secondary IP address your NIC, because I don't use SuSE (I've installed it, but haven't really done any networking with it). You should be able to do it in YaST, but I haven't tried. I think that you just modify /etc/sysconfig/network-scripts/ifcfg-eth0 to have the line SECADDR=<secondary ip> but it has been several years since I have tried putting multiple IPs on a single NIC.
 
Old 10-24-2003, 10:49 AM   #3
Kumado
Member
 
Registered: Oct 2003
Location: Ohio , USA
Distribution: up to Suse 13.1
Posts: 71

Original Poster
Rep: Reputation: 25
Thx, but I really do want a second machine for the web server, The NAT seems to have alot on it's hands and I was told that I would have 'less' chances of hacking if it was inside ( behind the NAT from Internet side ) my LAN.
I need for the NAT to remain uneffected by people other than myself. Being at a school, and students maintain the web pages ......
 
Old 10-24-2003, 11:45 AM   #4
pansophic
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
Sorry, I mis-understood your post. I thought that you wanted to run a second web server. You definitely want a second machine as a web server, you just don't need two web servers.

When you configured the NAT rules, did you use a tool, or edit the IP_Masq script(s) directly? You really just need to add a Forward rule to get the web requests to go to your web server.

The following is a link to IP Masquerading and how to set up a port 80 forward to the web server on the inside of your network. It assumes that you are using iptables, not ipchains, but the concept is nearly identical for ipchains.

http://en.tldp.org/HOWTO/IP-Masquerade-HOWTO/forwarders.html

I didn't find any help on the SuSE site for setting up a secondary IP address (for your Internet facing system) to allow you to bind multiple addresses to that external interface. But in the interim, you can just forward the one IP that you have working to the Webserver on the inside.
 
Old 10-24-2003, 08:29 PM   #5
Kumado
Member
 
Registered: Oct 2003
Location: Ohio , USA
Distribution: up to Suse 13.1
Posts: 71

Original Poster
Rep: Reputation: 25
I wish I had the termonolgy better, but let me try a different way to see if anyone can make sense out of my nonsense

My NAT box has a live IP ( seemed to be the only way it would work ) and I have 2 more available to me for future use.

One, I will reassign the www.scjvs.com we own to that IP, once I am able to pass thru the NAT and forward ( port 80, SSL, FTP, mail ... ) to the web server inside the LAN. I want it inside for protection and for the Axis mini-web cams we use in the building. I want to be able to load images onto one of the web page links for WWW use. ( This beats trying to get to the cams thru the NAT ).
I have plans later for openning a second web site on the third IP with the other .com we own.
If Apache will host both sites as virtual on one box and the load is ok, that would be good too.

Thx Much

Kumado
 
Old 10-25-2003, 01:08 AM   #6
locutus233
Member
 
Registered: Aug 2003
Location: South Surrey, BC
Distribution: Redhat, Gentoo
Posts: 47

Rep: Reputation: 15
The correct way to setup what you wants is as follows:

1. Setup a DMZ with one IP address and place your production system in there. Using NAT, you can place several systems in here. Your database servers don't need to be publicly exposed.

2. Setup a router/NAT with another IP address and place your network there. Ensure you restrict travel so that traffic only goes out.

However without using some more expensive routers what you appear to want to do many not be possible without adding another interface card to your routing nat machine.
 
  


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
nat routing vaat Linux - Networking 11 02-16-2005 11:02 AM
routing through nat booyah Linux - Networking 3 01-17-2004 09:40 PM
2 IPs -> NAT -> Webserver Kumado Linux - Networking 3 10-31-2003 10:32 PM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 04:11 PM
Routing behind NAT bax *BSD 5 04-26-2003 06:38 PM

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

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