LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2014, 12:05 PM   #1
cilbuper
Member
 
Registered: Mar 2008
Posts: 141

Rep: Reputation: 0
Question 3+ networks on each machine (Linux & Windows) how to appoint priority network


I have a few networks that all my systems are connected to. Two of them have internet connections and the third is strictly internal and has my file servers, NAS and other devices I don't want to allow outside access to.

I can find which internet connection is being used by default by theach system but when it comes to connecting to each machine within the network, I don't know how it is being done and which network connection is being used (I guess I coud look at adapter statistics but often all machines are busy transfering so it gets messy.

I'm wondering what is the best way to handle the hosts file when there are at least 3 IP addresses, each on a different network, for each machine.

Is there any standard way of handling this type of setup and which network should be used for which type of traffic. Also the hosts file issue is something I'd love some suggestions on.

Anyone have any thoughts on this? Thanks.
 
Old 12-21-2014, 01:03 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,340

Rep: Reputation: Disabled
You're asking three different questions here:
  1. How does routing work when a computer is connected to more than one network?
  2. How does name resolution work in a scenario where multiple network connections are involved?
  3. Are there any guidelines/best practices one should follow when setting up a network like this?
As for the first question, the critical part of the setup has to do with the choice of "default gateway". In most networks, IP addresses are handed out automatically via DHCP, and along with then IP address, each client gets told which gateway to use. That's problematic when several networks are involved, because multiple "default" gateways simply doesn't work in most scenarios. (And it doesn't make sense anyway; how can there be more than one "default" of anything?)

When a host is told to use two "default" gateway, the TCP/IP standard dictates that traffic should be load balanced across both/all gateways. If one or more of those gateways perform Network Address Translation (which most do these days if they're connected to the Internet), the result will be slow/unstable/no Internet access. There is no way to configure the DHCP servers/scopes in such a way that one gateway will take precedence over the other. In general, multiple network connections should be avoided for all non-routers, unless all but one network has a gateway.

About name resolution: You mention the "hosts" file, which is an ancient way of providing name resolution in networks. Sure, it works, but you really should consider setting up a local DNS service, if at all possible.

But again, if you have multiple network connections that each provide different DNS server settings via DHCP, it's all going to be a big mess. You can indeed specify multiple DNS servers on a host, but the host will interpret that at "always use the first server unless it's completely unavailable, and only then proceed down the list". Unless you can redesign your network, the "hosts" file may actually be your best bet.

"Best practices" would be to separate the networks using a firewall/router instead of connecting each client to multiple networks. That would be the quickest and most efficient way to solve all your issues. In a corporate environment one would usually configure a VLAN for each network, and since switches supporting VLANs/802.1q are really cheap these days, that's what I'd recommend.
 
Old 12-27-2014, 02:47 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,981

Rep: Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625Reputation: 3625
hosts files are great for some situations. In most default installs the hosts file is used at each look up for a name to ip. It can be set to be a lower priority if needed. For example dns doesn't resolve so then go look at hosts or other for resolution. I use them all the time but for other reasons.

To select a route based on the application would require usually a layer 7 plus firewall or appliance. It may be possible in some apps to tell the gateway or other feature to determine path. Some of the older apps in linux may have that feature. Many newer ones simply default to the host computer setting.

I'd agree that 2 or 3 real network (or vlan) would suite you but at some point you have to realize they may end up being connected if you break any rules to keep them apart.

Last edited by jefro; 12-27-2014 at 02:48 PM.
 
  


Reply



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
Ubuntu Linux & Windows 7 - Dual Boot or just use Windows in a Virtual Machine? spinnerette Linux - Newbie 29 06-29-2013 08:19 AM
How to transfer files from a linux machine to a windows machine which are not in the same network Lakshmi Yallampalli Linux - Networking 6 07-16-2010 04:50 AM
Windows & Linux on one machine m.veeravagu Linux - General 2 12-16-2004 03:12 AM
i can't browse my linux machine from windows machine's network neighbourhood window yagneshmistry Linux - Networking 2 08-10-2004 02:52 AM
linux machine does not connect to the network in windows network Bzuco Linux - Networking 2 07-19-2004 04:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:33 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