Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I would like to setup a local linux file server (using centos and samba) that can be accessed by two independent local networks in the same house. I have 2 networks on the same floor which have Windows 7 computers, but the networks are split as we have 2 internet connections. How do I go about this?

Additional info: Currently both the networks use DropBox to send files to each other but that happens via the Internet and hence its slow. Would like to achieve the same locally to increase the speed.

share|improve this question
up vote 2 down vote accepted

The easiest way, in my opinion, is to just have a single local LAN ( and vary who uses which internet connection by giving them a discrete gateway.

  • GW1:
  • GW2:
  • FileServer

That way everyone can access the same file-server, but when they go to the Internet they use the appropriate connection for their location. Of course changing which gateway they use is as simple as changing the, er, gateway address, but this is a simple config.

share|improve this answer
how can I configure the gateway on my routers? sorry for such a noobish question but I really don't know: I have 2 internet connections (both have public ip's) but have NAT enabled hence one connection's gateway is and the other's is Both are behind routers one lan is on 192.168.11.* and the other is 192.168.1.* Hence the gateways used on client computers are and Now what do I do? – rzlines Dec 22 '10 at 19:00
@rzlines If your routers have the option, configure a static route to the other local subnet, and set the default route in each discrete router to be the Internet interface for that router. – sysadmin1138 Dec 22 '10 at 19:11
Why wouldn't you disable DHCP completely on the routers, and then setup Linux box to serve DHCP. That way you could easily setup reservations serving a different gateway to each client. – Zoredache Dec 22 '10 at 19:29
@rzlines, not the way I described. Load balancing is possible, but far more advanced to setup. – Zoredache Dec 22 '10 at 19:38
Here is a diagram if someone wants/needs a picture to better understand. – Zoredache Dec 22 '10 at 20:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.