Solved

Getting two machines in different domains to communicate over home LAN

Posted on 2003-11-03
15
333 Views
Last Modified: 2010-03-18
Machine A is a home desktop set up with the standard LAN domain 192.168.1.x.

Machine B is a laptop which spends some time at home and some time in the office. It has static IP settings for the office with domain 131.111.25.x .

When machine B is taken home and attached to the LAN, it can't see or be seen by machine A. The LAN doesn't have a dedicated router, just several client machines connected by a switch. It's not connected to the internet, although it might be in future.

How should B be set up in order that it can maintain its domain and IP address settings for the office, but still participate in the LAN when it is brought home, without having to reset something manually every time?
In particular, is it possible to achieve this by making one of the machines on the LAN a gateway with suitable settings?

Linux variety of all machines is Debian. Thanks for your help.
0
Comment
Question by:glebspy
  • 5
  • 4
  • 3
  • +1
15 Comments
 
LVL 9

Expert Comment

by:majorwoo
ID: 9671584
you could switch your home network to use the same IP scheme - if you are behind a NATing firewall, it won't cause you any problems.  How do machine A and B connect to the net when they are home?
0
 
LVL 1

Author Comment

by:glebspy
ID: 9671777
It is somewhat unusual but I am not connected to the net at home (yet!). The purpose of the home lan is to support a parallel cluster so at the moment it doesnt have an external connection.

The solution you propose certainly works, but I want to keep the settings of machine A as 192.168.1.x . The reason is that, as you suggest, I may want to connect the cluster to the net via PPP or PPPOE, *without* network address translation. The connection might end up containing a NATing device, or it might not. So I wish to keep the settings of machine A and B as they are, in order to be sure that there will be no future problems. I should have mentioned this.

Is there a solution on these terms?
0
 
LVL 9

Expert Comment

by:majorwoo
ID: 9671857
you could place another machine in the loop with 2 nic's and have it act as a bridge between the two subnets - even using the desktop(machine A) with a second NIC for this purpose

The other option is to write a simple script that switches your net settings betweeb home/office for the laptop on bootup, i used to have something simple like that for handling my wireless and docked/undocked settings
0
 
LVL 1

Author Comment

by:glebspy
ID: 9671892
The 2nic idea is practical as far as hardware is concerned but it sounds complicated to set up. Also can you explain why it is necessary? i.e. why does a bridge require 2 network cards?
0
 
LVL 9

Expert Comment

by:majorwoo
ID: 9672419
A bridge serves as a gateway between two networks - it handles the translation from one network to the other.

The reason you need 2 NIC's is that you need to have it connected to both networks, for example the machine in the middle acting as the bridge, needs to have an IP on both schemes, so in your case it might be

eth0: 192.168.0.1
eth1: 131.111.25.1

and essentially passed the traffic between them back and forth.  It actually painless to do,

#1 - add the second NIC to the machine,
#2 - setup the IP for it on the second network (the 131. for you, since the first card is already on 192)
#3 - enable IP forwarding.  (in redhat which may be different echo "1" > /proc/sys/net/ipv4/ip_forward )
0
 
LVL 1

Author Comment

by:glebspy
ID: 9672585
ok I understand what you are saying but is there really no way of achieving the same thing with only one network card? Particularly I'm thinking, isnt it possible to use netmasks to make the network traffic independent of the first three bytes of the IP address, and only look at the fourth (the .x)? If not, then what are netmasks for?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:majorwoo
ID: 9672857
netmasks work the other way - you can ignore anything but the first quad (an IP such as 192.168.0.1 is called dotted quad notation)

so you could get it to treat 192.199.25.48 and 192.12.184.167 as the same network by trating them as 192.X.X.X but not the other way around.  Hence the second network card to have one machine act as the bridge between them.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 250 total points
ID: 9676901
on your laptop do:
  ifconfig eth0:1 192.168.1.y up
  route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.y
0
 
LVL 1

Author Comment

by:glebspy
ID: 9677630
192.168.1.y means some local static IP address which we choose for the laptop right?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9677845
yes, .y just to mark that it is different to .x
0
 
LVL 9

Expert Comment

by:majorwoo
ID: 9678914
its a second IP for the NIC (virtual adaptor), I've never done it myself - but if ahoffmann says it works it must ;-)
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 9679488
yes it's a virtual NIC
0
 

Assisted Solution

by:troy_
troy_ earned 250 total points
ID: 9728738
Yeah, the virtual nic is the right idea, especially because you only want to connect to the local network at home (no internet).  Here is what I would do:

ifconfig eth0:1 192.168.1.3

This should allow that machine to participate in the local network freely.  If you later want internet access, then you could just add another gateway, like this:

route add default gw 192.168.1.1

I actually typed these commands in to my machine and it took it without question, of course I don't have a gateway at that address to test, so let us know if this works.

I had a similar problem and I elected to just set up a dhcp server both at the office and at home - now mine is happy no matter what.  I set the laptop for dhcp and it "just works".

Troy

Troy
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now