LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 11-19-2010, 12:49 PM   #1
user100
Member
 
Registered: Aug 2010
Posts: 64

Rep: Reputation: 0
ip address question


Hi,

How can I get two ip addresses to communicate with each other which are not in the same 255 range?

Like:

192.168.0.1
and
192.168.1.1


Thanks.
 
Old 11-19-2010, 01:39 PM   #2
grzesiek
LQ Newbie
 
Registered: Nov 2010
Location: Poland
Distribution: Debian
Posts: 20

Rep: Reputation: 0
iptables FORWARD?
 
Old 11-19-2010, 01:44 PM   #3
0.o
Member
 
Registered: May 2004
Location: Raleigh, NC
Distribution: Debian, Solaris, HP-UX, AIX
Posts: 208

Rep: Reputation: 35
http://en.wikipedia.org/wiki/Router
 
Old 11-19-2010, 01:50 PM   #4
okcomputer44
Member
 
Registered: Jun 2008
Location: /home/laz
Distribution: CentOS/Debian
Posts: 246

Rep: Reputation: 53
Quote:
route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0
adds a route to the network 192.168.1.x via "eth0". The Class C netmask modifier is not really necessary here
because 192.* is a Class C IP address. The word "dev" can be omitted here.
This is from the man route command examples. You need to add new route(s) for your network(s) that your box does not know.

You have to do it on both boxes vica versa. Both boxes have to know the routes to properly communicate to each other.

Have a look this site for more info: http://www.labtestproject.com/linnet/routing.html

I hope this helped for you.

Laz.
 
Old 11-19-2010, 03:52 PM   #5
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hello user100,

change the mask to 255.255.128.0. Then both IP-adresses are in the same network (subnet) with the networkadress 192.168.0.0/23.

Markus

Last edited by markush; 11-20-2010 at 12:48 AM. Reason: added an explanation
 
1 members found this post helpful.
Old 11-19-2010, 08:41 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,982

Rep: Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626Reputation: 3626
Well, or more simply 255.255.0.0 as netmask. They would then be on the same subnet and could then directly connect without a router or gateway.

The normal way to have two out of subnet is to use a gateway or router.


One could also put in a secondary IP within the the range on one of the nics.

Last edited by jefro; 11-19-2010 at 08:43 PM.
 
Old 11-20-2010, 12:29 AM   #7
Juako
Member
 
Registered: Mar 2010
Posts: 202

Rep: Reputation: 84
If the two machines are in the same network, jefro or markush solution will work ok. If not, you need a router.
 
Old 11-20-2010, 04:00 AM   #8
user100
Member
 
Registered: Aug 2010
Posts: 64

Original Poster
Rep: Reputation: 0
Thanks. It may take me a while to go through the info though.
 
  


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
ip address question ? thok Linux - Networking 1 10-24-2007 07:22 AM
ip address question! Jmcatch742 Linux - General 2 01-13-2005 06:25 PM
IP Address question jolu2000 Linux - Networking 4 06-01-2003 09:31 PM
question about network address and broadcast address yuzuohong Linux - Networking 1 09-18-2002 11:47 AM
Question about my ip address. XillusionsX Linux - Networking 3 12-06-2001 06:16 AM

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

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