LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2010, 08:05 AM   #1
moorthy12004
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
Unhappy hi, how to connect two different ip classes in lan in linux.


Hi,
in our lan connection setup. having 192.168.1.0/24 and 192.168.2.0/24 how do i connected intermediately. server are RHEL5. Kindly help to setup.
 
Old 06-14-2010, 08:23 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
You need a router to connect 2 networks.
 
0 members found this post helpful.
Old 06-14-2010, 08:31 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
You have to create a static route.

Whichever one is on eth0 should be your "default route" (the one you list as "GATEWAY=" in /etc/sysconfig/network.) This would typically be the IP to the router/switch.

You then setup a route for your secondary card (e.g. eth1) in /etc/sysconfig/network-scripts in a route-<device> file (e.g. route-eth1).
In that file you would need:
GATEWAY0=x.x.x.x
NETMASK0=x.x.x.x
ADDRESS0=x.x.x.x

Where GATEWAY0 is the IP of the switch/router that the second network's IP goes to and NETMASK is appropriate to your /24 network. ADDRESS0 is the IP range you want.
 
  


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
how to connect a pc with xp to a computer with linux using lan lyonm Linux - Networking 1 04-13-2009 02:42 PM
how to connect linux pc with xp pc through lan? hridyesh Linux - Newbie 3 12-24-2008 12:23 AM
Linux unable to connect to my new home LAN tallmtt Linux - Networking 5 03-07-2008 02:11 PM
how to connect 2 different LAN using linux router madm21 Linux - Networking 2 09-14-2007 01:30 AM
No Internet but LAN and VPN connect LAN work fine??? xavior SUSE / openSUSE 7 11-09-2005 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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