LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Private web server for multi-homed machine (https://www.linuxquestions.org/questions/linux-networking-3/private-web-server-for-multi-homed-machine-450685/)

smithsa 06-01-2006 04:12 PM

Private web server for multi-homed machine
 
I've got a networking problem that I'm hoping someone can help me with. I have a computer with 2 ethernet cards that's running Damn Small Linux (Although this could change if necessary. I could run a different distro if necessary as long as I can boot off of a CD).

One ethernet card is plugged into a router and running on the 192.168.0.X network (as assigned by the router's DHCP server). What I want to do is use a crossover cable to connect the other ethernet card to another computer that's not connected to anything else. The only purpose of this computer is to run a web server on port 80 that will be accessed from the multi-homed computer. Nothing else needs access to this machine.

What do I need to do to set this up? Does the multi-homed computer need to run a DHCP server to assign an IP address to the web server machine? How should the second ethernet card get an IP address, and does it need to be on a different network then the first card? Does the web server computer need to get its IP address from DHCP? Is there anything I can do if that machine has a default IP address assigned to it, like in the case of a network-enabled device such as a network enabled webcam?

I'd really appreciate any help I can get. I'm also not really a Linux person, so the more details you can give, the better.

Thanks in advance,

Sander Smith

TigerOC 06-04-2006 03:05 AM

It's better to use static ip addresses in this situation. You don't say what os you are using on the 1st box. Basically you need to place the second box on a different subnet to the 1st. In this case you have the primary addresses on 192.168.0.X so you could use 192.168.1.X for the second range. You would need to tell the router to forward requests for port 80 ( conventional www access) to the ip address of the Internet server. The next step is to get forwarding going from the first box to the second. i.e. you need to tell the 1st box to forward requests on port 80 to the second box. You would have to work this out for yourself based on the os.The next thing is gateway addresses. The gateway for the server is the ip address of the ethernet card the server is attached to on the 1st box and the 1st box uses the router address as the gateway.
Pay particular attention to security of the server with regard to a fire wall and ssh access. If you don't need access the server from outside your own lan only have port 80 open to reduce the risk of compromise. There are lots of bad people out there that are going to be probing the server for holes from the minute you put it on line. Make sure you read the security recommendations in the security section of LQ. You may think that your server does not contain anything important and you don't need anything fancy but it could easily be hijacked and used to attack other servers out there so please be responsible in your approach.
I also have some basic info on adsl based servers with links to other info on my server.


All times are GMT -5. The time now is 01:51 AM.