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-13-2010, 12:57 AM   #1
dave247
Member
 
Registered: May 2004
Posts: 206

Rep: Reputation: 30
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?

Last edited by dave247; 12-13-2010 at 01:05 AM.
 
Old 12-13-2010, 02:30 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 12-13-2010, 03:43 PM   #3
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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.

Last edited by sag47; 12-13-2010 at 03:47 PM.
 
Old 12-14-2010, 02:45 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
No, it's not a bridge, he's describing a router, not a bridge. I know what a bridge is, thanks.
 
Old 12-14-2010, 04:11 AM   #5
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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.
 
Old 12-14-2010, 04:16 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 12-14-2010, 04:25 AM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Okay, my misunderstanding. It's been a while since I've read up on the OSI 7 layer model.
 
Old 12-14-2010, 04:32 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
Old 12-14-2010, 05:09 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by catkin View Post
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.
 
Old 12-14-2010, 05:25 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks Chris I've tried Wikipedia and still not managed to install a clear picture in my mind
 
Old 12-14-2010, 05:33 AM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.

Last edited by jschiwal; 12-14-2010 at 05:41 AM.
 
Old 12-14-2010, 06:12 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks jschiwal That helped, especially http://www.tcpipguide.com/free/t_OSI...rsandLayer.htm onward.
 
Old 12-16-2010, 05:50 PM   #13
dave247
Member
 
Registered: May 2004
Posts: 206

Original Poster
Rep: Reputation: 30
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

Last edited by dave247; 12-16-2010 at 05:52 PM.
 
Old 12-16-2010, 06:03 PM   #14
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
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

Last edited by kdelover; 12-16-2010 at 06:13 PM.
 
Old 12-16-2010, 06:05 PM   #15
dave247
Member
 
Registered: May 2004
Posts: 206

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by kdelover View Post
Hi,

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

Last edited by dave247; 12-17-2010 at 01:51 AM.
 
  


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
Run 2 NICs, separate networks liche24 Fedora 1 03-14-2009 11:20 PM
Using a separate /home partition. Sgt Canuck Linux - General 6 03-10-2009 01:22 PM
Home directory on separate partition Steve W Linux - Newbie 5 03-12-2008 12:37 PM
Home directory on separate partition Steve W Linux - Newbie 2 03-12-2008 12:36 PM
Firewalls for home networks, is separate justified? setiDude Linux - Security 12 10-18-2004 08:55 PM

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

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