LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   how to connect separate home networks? (http://www.linuxquestions.org/questions/linux-networking-3/how-to-connect-separate-home-networks-849846/)

dave247 12-13-2010 01:57 AM

how to connect separate home networks?
 
I am trying to increase my understanding of ip networking.

I have my main network with internet and DHCP which is on 192.168.x.x with a router.

Now I have set up an Ubuntu file server and i want it on a separate home network with static ip addresses range of 10.x.x.x. and it is also connected to a router.

So i will have two networks, one private static with no direct internet access, and the other with internet and DHCP. I want to know how I would "bridge" these two networks so that I could access my file server from the DHCP network. How is this typically done?

acid_kewpie 12-13-2010 03:30 AM

you would not bridge them, that's very much the wrong word. bridging is for layer 2 connections, e.g. using a switch (which is a multi port bridge). You'd route them, possibly with some natting at the L3 boundary. Where is the router that holds these two networks in conjunction with the internet connection? If it's the same device then there should be no need to do anything at all - a device on all machines default gateway is directly connected to each interesting network, so everything relevant is all known about.

if these are different routers connecting to the same subnet, then all devices on the DHCP network would need to know that the other network lives off in a special direction. This could probably actually just be done on the internet router by adding a static route on that device to point all traffic trying to head towards the internet for the other network to be redirected to the other router, but in general this culd get a little messy and you could instead put a route directly on to each of the potential clients to tell it that 10.1.2.0/24 is via 192.168.1.254 or whatever the ip address is of the joining router on the 192.168 network. Given that the static network is only having one way out there should be no need to do anything interesting on those machines, just let them stick to their default gateway.

sag47 12-13-2010 04:43 PM

Actually bridge is the correct term and it is not a switch. It is a computer with at least two network cards on different subnets which allows the two separate networks to communicate with one another. I've run a bridge using Windows 2000 Server before. You're right about it being on Layer 2 of the OSI model though.

As for how to implement that on Linux. Look up "iptables bridge" in google. There's tons of examples.

acid_kewpie 12-14-2010 03:45 AM

No, it's not a bridge, he's describing a router, not a bridge. I know what a bridge is, thanks.

sag47 12-14-2010 05:11 AM

For what the OP wants done, connecting two networks and access a file share across them, a bridge is necessary. A router would not be adequate. You don't if that's what you think needs to be done. I don't care for this to turn into a heated discussion.

acid_kewpie 12-14-2010 05:16 AM

he has two seperate ip subnets 192.168.x.x and 10.x.x.x, these are in different layer 3 space, therefore needs a layer 3 device to connect them, not a bridge, at layer 2.

sag47 12-14-2010 05:25 AM

Okay, my misunderstanding. It's been a while since I've read up on the OSI 7 layer model.

catkin 12-14-2010 05:32 AM

Can you recommend any introductory links for the 7 layer model, Chris? I really ought to be able to understand it having knowledge of electronics, communications systems theory, practical network administration and networked applications but every time I try to understand the 7 layer model I get lost in a welter of edge case detail and specialist jargon. This is a pity because a clear understanding of the 7 layer model would be very helpful when thinking about networking as this thread has already demonstrated.

acid_kewpie 12-14-2010 06:09 AM

Quote:

Originally Posted by catkin (Post 4190796)
Can you recommend any introductory links for the 7 layer model, Chris? I really ought to be able to understand it having knowledge of electronics, communications systems theory, practical network administration and networked applications but every time I try to understand the 7 layer model I get lost in a welter of edge case detail and specialist jargon. This is a pity because a clear understanding of the 7 layer model would be very helpful when thinking about networking as this thread has already demonstrated.

Not in my mind, TBH. I'd just look over Wikipedia most likely. It certainly is useful to be able to see these discrete levels within the technologies and appreciate what things are relative to what. Mostly it's down in the networking levels, but when you're doing things like application load balancing it also comes in very handy, knowing what do do and don't have the right to mess with etc.

catkin 12-14-2010 06:25 AM

Thanks Chris :) I've tried Wikipedia and still not managed to install a clear picture in my mind :(

jschiwal 12-14-2010 06:33 AM

catkin: This site might help http://www.tcpipguide.com/free/t_Upp...sServicesa.htm

Dave247:

You might want to download the Network Admistrators Guide from the www.tldp.org web site.

catkin 12-14-2010 07:12 AM

Thanks jschiwal :) That helped, especially http://www.tcpipguide.com/free/t_OSI...rsandLayer.htm onward.

dave247 12-16-2010 06:50 PM

hmm.... ok lets start over for my own sake.

I have two Linksys WRT54GL routers representing two different networks with hosts and neither routers are connected to the internet. One network is 198.192.x.x and the other is 10.10.x.x.

What is the correct approach for connecting these two networks?


Side note: For my equipment, I have these two routers and one semi-old network switch and several hubs.

again, I'm just trying to get a better understanding about how networking works beyond reading the books. I have been in a pc networking degree for over 5 years and I still don't fully understand how networks communicate as in the situation above. I mean, I understand what NAT and ARP are and how complex networking infrastructures work to route ip traffic, but on the most basic scale, and as far as my own home set up, I want to be able to make things work with the least amount of tools possible -- for learning purposes.

thanks again
dave247

kdelover 12-16-2010 07:03 PM

Hi,

Wouldn't a static route between the two routers work?

[192.168.1.x ]---(192.168.1.200)router A(192.168.2.1)-------static routes------(192.168.2.2)Router B(10.0.0.200) ---[ 10.0.0.x ]

192.168.1.200 & 10.0.0.200 should be your default gateways

router A> route add net 10.0.0.0 netmask 255.0.0.0 gw 192.168.2.2

router B> route add net 192.168.1.0 netmask 255.255.255.0 gw 192.168.2.1

dave247 12-16-2010 07:05 PM

Quote:

Originally Posted by kdelover (Post 4194117)
Hi,

Wouldn't a static route between the two routers work?

EDIT: nevermind


All times are GMT -5. The time now is 08:01 PM.