LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-03-2011, 07:23 AM   #1
vaas45
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
connecting two subnets via a linux server


hi!
i have two subnets with different gateways.i am thinking of connecting them via a linux server which would enable them to communicate.but i dont know how to proceed for getting this done.how should the connection be made and what should be the configuration settings on the linux server.pls explain in detail cause i don't have a really good practical knowledge on this subject.
thank you!
 
Old 03-03-2011, 07:39 AM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
First you would need to set up your Linux server so that it is on
both subnets. Typically this means having two network interfaces,
one connected to each. Then you need to make sure IP forwarding
is allowed. `cat /proc/sys/net/ipv4/ip_forward` would be one if
forwarding is allowed and zero if not. To enable it, type
"echo 1 > /proc/sys/net/ipv4/ip_forward". You might want to check
your iptables settings to make sure this traffic is allowed.

After the server is set up, you'll need to go to each client
(unless you use dhcp) and add a route to the other subnet using
the Linux server's address on the same subnet as a gateway.
If a client on one subnet needs to connect to a client on the
other subnet, both clients need to have the route added.

I hope this makes sense. Please post if you have any questions.

Last edited by carltm; 03-03-2011 at 07:39 AM. Reason: fixed typo
 
Old 03-04-2011, 07:41 AM   #3
taylorchase
Member
 
Registered: Feb 2006
Location: Nova Scotia, Canada
Distribution: Ubuntu 12.04, SLES 10, OS X 10.6
Posts: 73

Rep: Reputation: 15
You could try setting up a VPN to connect the 2 subnets.
 
  


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
Pinging and connecting between subnets TooMad Linux - Networking 6 12-04-2009 02:33 PM
Connecting 2 subnets tro11 Linux - Networking 14 01-14-2009 02:44 PM
Connecting different subnets on a single switch taiwo222 Linux - Networking 1 02-05-2008 02:09 PM
connecting between subnets thirdorderharmonic Linux - Networking 4 12-15-2006 10:42 AM
connecting two subnets FredL2 Linux - Networking 2 08-18-2006 03:47 PM

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

All times are GMT -5. The time now is 04:54 AM.

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