Link to home
Start Free TrialLog in
Avatar of geir056
geir056

asked on

Ubuntu intranet server for two isolated networks...

Hi,

I have a ubuntu box where I want to run an intranet web server, the box has two nics, one at 192.168.33.10 and the other at 172.22.100.10. No internet access is involved in this scenario, only intranet services.

This webserver (apache) should be available from both networks, however, traffic from any of these two networks should under *no circumstance* be allowed to 'leak' over to the 'opposite' network.

I.e. workstations from both networks should be able to access the webserver's port 80 and 443, but nothing else.

How do I set up this so I'm absolutely sure that no traffic leaks between these two nics...?

Thanks a lot for some guidance here

regards

Tor
Avatar of Pablo Allietti
Pablo Allietti
Flag of Uruguay image

you can define virtualhosts for this in this document you have many examples
http://www-uxsup.csx.cam.ac.uk/pub/doc/suse/suse9.2/suselinux-adminguide_en/ch23s09.html

and y cut a part of this

23.9.2.2. Virtual Hosts with IPs

Once IP aliasing has been set up on the system or the host has been configured with several network cards, Apache can be configured. Specify a separate VirtualHost block for every virtual server:

<VirtualHost 192.168.1.20>
    ServerName www.myothercompany.com
    DocumentRoot /srv/www/htdocs/myothercompany.com
    ServerAdmin webmaster@myothercompany.com
    ErrorLog /var/log/apache2/www.myothercompany.com-error_log
    CustomLog /var/log/apache2/www.myothercompany.com-access_log common
</VirtualHost>

<VirtualHost 192.168.1.21>
    ServerName www.anothercompany.com
    DocumentRoot /srv/www/htdocs/anothercompany.com
    ServerAdmin webmaster@anothercompany.com
    ErrorLog /var/log/apache2/www.anothercompany.com-error_log
    CustomLog /var/log/apache2/www.anothercompany.com-access_log common
</VirtualHost>
Avatar of geir056
geir056

ASKER

Thanks for the tip regarding virtualhosts.  However I realize that I might have expressed myself unclearly.

The webserver mentioned is *the same* for both subnets, i.e. that both nic1 at 192.168.33.0 and nic2 at 172.22.100.0 should both have access to the 'myintranet.local' webserver.  In this case I assume that I don't need to use virtualhosts.

However as stated in the original post my main concern is that both networks should be completely isolated from each other, and only traffic on port 80 and 443 from each of the two nics should be able to talk to the webserver.  But at the same time traffic from one of these nics should be about galvanically isolated from the other nic and vice versa...

Would it be easier to insert a third NIC (nic3 at 192.168.11.10) in the box and assign this nic to the webserver?  Then we have a 'real' ip address for the webserver and I can also use this NIC for other services that I want to share for both networks.

Thanks for comments on this

regards

Tor
ASKER CERTIFIED SOLUTION
Avatar of Pablo Allietti
Pablo Allietti
Flag of Uruguay image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geir056

ASKER

OK, but as I'm a newbie I need to know the exact commands and in which file to put them.

You assume that I have three nics as mentioned in the last post and that nic3 listens to nic1 and nic2.   Apache is configured to listen to ni3's IP, right?

Thanks

Tor
Change as the others said the file:
and put virtual hosts, maybe listen would suffice but virtual host is better, so you know what is what, and if you want to have separated dirs.
http://www.debuntu.org/2006/02/22/7-virtual-hosting-using-apache-2
there is a good howto.
Avatar of geir056

ASKER

Sorry but I am still confused.  When I open the link above it says:

'Virtual Hosting allow web servers to host more than one website on a single machine.'

This is exactly the opposite of what I am asking for.  I want the *same webserver/website* to be visible from two different nics, but I want the nics to be completely isolated from *each other*  

Do I get this result by using virtual hosts..?

Thanks for comments

regards

Tor