0

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.

rzlines
  • 219
  • 6
  • 18

1 Answers1

2

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

  • GW1: 192.168.128.1
  • GW2: 192.168.128.2
  • FileServer 192.168.128.20

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.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • 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 192.168.1.1 and the other's is 192.168.0.1. 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 192.168.11.1 and 192.168.1.1. Now what do I do? – rzlines Dec 22 '10 at 19:00
  • 1
    @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
  • @sysadmin1138 I have a routing table in the router with gateway 192.168.1.1 it already has 3 routes configured http://i.imgur.com/fTwuc.png the ones cancelled have my static ip address. How do I route it to the other router with gateway 192.168.11.1 – rzlines Dec 22 '10 at 19:20
  • @sysadmin1138 - this is what I get when I click add route http://imgur.com/cE4qc.png should I set it like this http://i.imgur.com/djQ6j.png. – rzlines Dec 22 '10 at 19:22
  • 1
    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
  • so basically this linux box would be take both my internet connections and load balance them and serve DHCP? – rzlines Dec 22 '10 at 19:33
  • 1
    @rzlines, not the way I described. Load balancing is possible, but far more advanced to setup. http://lartc.org/howto/lartc.rpdb.multiple-links.html – Zoredache Dec 22 '10 at 19:38
  • 1
    Here is a [diagram](https://docs.google.com/drawings/pub?id=1t_suBFJIM5MaQFUBAyMwLP9IJkjq6YAkRydDBYmzFH0&w=960&h=720) if someone wants/needs a picture to better understand. – Zoredache Dec 22 '10 at 20:46