LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-08-2008, 06:47 PM   #1
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Rep: Reputation: 70
Two network interfaces and two networks


Ok, I'm about to install Slack 12.1 on a server with two network interfaces.
The way the networks are supposed to be configured is like this.

Net1: (LAMP,internet only)
Static public IP address provided by ISP
Multiple domains, ftp, email server hosted on this network
In other words, it's a full LAMP server.

Net2: (Samba file server on local network only)
Dynamic IP address provided from a local Linksys router.
It's on a local, private network
The router gets a dynamic ip address from the same ISP as the first network interface
The ISP is providing one static IP that's given to the server and several dynamic IP's of which one is taken by the Linksys router.
The Linksys router manages a few local computers running (unfortunatelly) Windows.
The way the network is set up

Code:
ISP --> Cable modem --> Network switch --> LAMP Server (Slack)
                                       |
                                       --> Linksys router --> local network
Can this be done with Slackware?
The goal is to have the server be LAMP on Net1
and also be a Samba fileserver on Net2.

My main problem is I don't know what to choose for the main gateway and for the dns.
Do I have to set up Bind to help with resolving the networks?
So basicaly the two network interfaces serve two different networks which are independent.
 
Old 05-08-2008, 07:29 PM   #2
randomsel
Member
 
Registered: Oct 2006
Location: Wilmington, DE
Distribution: Slackware 11
Posts: 201

Rep: Reputation: 30
as long as both interfaces are in different networks (read: 'the network part of their ip address is different'), there's no problem at all. You can bind Apache to server only one of the networks, Samba to serve the other, and/or iptables to ensure the same.

Don't know if it can be done with the same network on both interfaces tho...

P.S. Setting up all those services is a non-trivial exercise left for the reader. Fun, but non-trivial.

Last edited by randomsel; 05-08-2008 at 07:31 PM.
 
Old 05-08-2008, 09:08 PM   #3
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by randomsel View Post
as long as both interfaces are in different networks (read: 'the network part of their ip address is different'), there's no problem at all. You can bind Apache to server only one of the networks, Samba to serve the other, and/or iptables to ensure the same.

Don't know if it can be done with the same network on both interfaces tho...

P.S. Setting up all those services is a non-trivial exercise left for the reader. Fun, but non-trivial.
Ok, thanks.
But my main question still remains.
What gateway to put in inet1.conf?
Can I have two gateways, one for each interface?
What about dns?
Heeeeeeelp!
 
Old 05-09-2008, 04:12 AM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105Reputation: 8105
Your computer needs only one default gateway. This gateway will be used for all addresses that are not on your local network. The default gateway address will be supplied by your ISP along with the small range of IP addresses you apparently can use.

For all the network segments directly connected to your server, you will never need a default gateway. I would suggest running "routed" on your server if you are planning connect other LAN's to your "local network".

By the way, the clients in your local LAN must have the IP address of your LAN's Linksys router set as the default gateway, but the DHCP server running on that Linksys should take care of that.

Looking at your drawing, I would have done the LAN setup differently. If you connect the Linksys to the cable modem, and all of the computers to the Linksys, then your server only needs 1 network interface. You can use the Linksys's port forwarding feature to forward HTTP traffic (for instance, other protocols work too of course) to port 80 of your internal server. This is how I have setup my internal network here. The Linksys acts as firewall/router for the whole internal network:
Code:
ISP --> Cable modem --> Linksys router
                              |
                              --> Network switch  --> LAMP Server (Slack)
                                       |
                                        --> other comps in local network
If you do not want that, I still see no real reason to have the Linksys in your LAN, because the Slackware server can act as DNS and DHCP server just as easily (or even better).

Eric
 
Old 05-11-2008, 04:09 AM   #5
Slackovado
Member
 
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 308

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by Alien Bob View Post
Your computer needs only one default gateway. This gateway will be used for all addresses that are not on your local network. The default gateway address will be supplied by your ISP along with the small range of IP addresses you apparently can use.

For all the network segments directly connected to your server, you will never need a default gateway. I would suggest running "routed" on your server if you are planning connect other LAN's to your "local network".

By the way, the clients in your local LAN must have the IP address of your LAN's Linksys router set as the default gateway, but the DHCP server running on that Linksys should take care of that.

Looking at your drawing, I would have done the LAN setup differently. If you connect the Linksys to the cable modem, and all of the computers to the Linksys, then your server only needs 1 network interface. You can use the Linksys's port forwarding feature to forward HTTP traffic (for instance, other protocols work too of course) to port 80 of your internal server. This is how I have setup my internal network here. The Linksys acts as firewall/router for the whole internal network:
Code:
ISP --> Cable modem --> Linksys router
                              |
                              --> Network switch  --> LAMP Server (Slack)
                                       |
                                        --> other comps in local network
If you do not want that, I still see no real reason to have the Linksys in your LAN, because the Slackware server can act as DNS and DHCP server just as easily (or even better).

Eric
Thanks Eric.
It looks like I have solved it though.
I still have to test the server for a while but so far it's holding.
As far as I can tell the problem I was having was network connectivity.
The server would not connect to the Internet and/or be visible from outside.
I had to set the
DHCP_KEEPRESOLV="yes"
DHCP_KEEPGW="yes"
to prevent the dhcp from the second interface wiping out the dns and gateway for the main interface.

As for the actuall wiring.
I understand your point about connecting through the Linksys router.
But I wanted the server to be open and avoid forwarding ports etc.
So the Linksys router is used used for the rest of the network and the server is on it's own network interface and is independent of the rest of the network other than serving as a Samba file server on the second network interface (and that duty is only for small backups of some files from the Windows computers).
I have couple other questions but I'll make them a separate thread.
 
  


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
Help on /etc/network/interfaces SimbaSpirit Linux - Newbie 2 02-03-2008 11:17 PM
Network interfaces do not bring up on network restart rajat Linux - Networking 1 06-20-2007 04:44 AM
For laptop - different networks in /etc/network/interfaces, or use network-manager? dmravaet Linux - Wireless Networking 4 03-17-2007 11:42 PM
Manual Network Setup Works, /etc/network/interfaces doesn't verdeboy2k Linux - Wireless Networking 0 05-31-2006 06:56 PM
Switching networks and interfaces? mlg9000 Linux - Laptop and Netbook 0 11-17-2004 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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