I need to connect several remote LANs with VPN so that the remote LAN machines should be in in the same subnet.

For example, LAN1 PC , remote LAN2 PC 192.168.0.30.

I have an application to which the clients connect by shares (Netbios - network device). I want to use it at home (LAN1), on workplace1 (LAN2) and workplace2 (LAN3).

It is that possible?? What hardware should I use??

Dani AI

Generated

Two viable architectures address the requirement that remote machines appear in the same subnet: a true layer‑2 (Ethernet) bridge across sites, or a routed (layer‑3) VPN with per‑site subnets plus name‑resolution workarounds. Layer‑2 makes every host share the same IP/DHCP domain but carries broadcasts and requires more care; routed VPNs are simpler and more robust but need DNS/WINS or static mappings so SMB/NetBIOS services remain reachable.

Layer‑2 approach (when a single subnet is mandatory): each site must terminate an Ethernet tunnel and bridge that tunnel into the local LAN so broadcasts and DHCP cross sites. Important operational notes: only one active DHCP server for the subnet, enable STP on the bridge to avoid loops, set the tunnel MTU lower (e.g. 1400) to avoid fragmentation, and avoid NAT on bridged traffic. On a Linux endpoint the minimal bridge steps look like:

brctl addbr br0
brctl addif br0 eth0 tap0
ip link set dev br0 up
# keep DHCP on the bridge, not on eth0

Also plan for the extra broadcast traffic and test throughput — layer‑2 tunnels can become chatty.

Layer‑3 alternative (recommended in many small deployments): give each site its own private subnet and route between them. Make NetBIOS/SMB discovery work across subnets by deploying a central name server or WINS, using DNS names or LMHOSTS entries for the few file‑share hosts, or running a small WINS/Samba server. DHCP relay agents can forward boot/DHCP requests to a central server if desired. Routed setups make firewalling, NAT avoidance, and performance tuning much easier.

Reference notes: raised the router vs appliance tradeoff, noted using an always‑on server for services, and pointed to L2 VPN options — those points map to the two architectures above. For a low‑cost, low‑maintenance build, a routed design with a small central service and WINS/DNS usually gives the best balance of reliability and minimal configuration.

Recommended Answers

All 6 Replies

You have two options, either a VPN enabled router, or build a fire-wall box with VPN. look into open VPN, it would let you set up one firewall system on LAN2 as the primary, and the other 2 would connect to it as clients. If you set the subnet and address reservations right it will do the job.

I am hoping to look into this for myself at the start of next year.

You will want a VPN Server, which can either be a standalone machine or built into a router. (not sure what models support it)

If you go the standalone machine, you will have to do some port forwarding to get things through. If someone knows whether this is disallowed, please respond.

The clients will simply need the client software. No special configurations otherwise.

I have been looking towards OpenVPN.

commented: Very good +2

You don't need to do port forwarding TO a standalone server if it's the first thing on the network. If it's after a router you would, but you can just as easily have it be the first step from the internet connection.

IF you have VPN "servers" at every location you don't need to install anything on client PCs, just the router/server that's bridging.

I need to use as cheap solution as possible.

The OpenVPN seems good for me. I first tried it on linux, which should have act as VPN server.

I didn't finish it, I had no time and had lot of other jobs ...

But now it is the right time to complete it.

I know that there is a version for Windows XP, and on my local net of workplace1 is one PC which runs 24 hours a day, probably this can be the simplest way.

But if I succesfully complete the VPN server with Linux, I would prefer this solution.

If I remember correctly, there is an XP version but I had some problems setting it up, my system didn't like the virtual network driver :(.

There is a linux based router firmware called DD-WRT, I use it at home. If you have a router that's compatible with it's VPN or "mega" versions it has openVPN built in.

I put it on a $100 Linksys 350N and it works like a charm.

Redhat Linux has Crypto IP Encapsulation (CIPE), a VPN

implementation developed primarily for Linux. CIPE uses encrypted

IP packets that are encapsulated, or "wrapped", in datagram (UDP)

packets.


CIPE packets are given destination header information

and are encrypted using the default CIPE encryption mechanism.


The packets are then transferred over IP as UDP packets via the

CIPE virtual network device (cipcbx) over a carrier network to an

intended remote node.


One network is running CIPE on the firewall, and a remote client

machine acting as a CIPE-enabled node. The CIPE connection acts

as a tunnel through which all Intranet-bound data is routed

between remote nodes.


CIPE can be configured for communication between two or more

CIPE-enabled Linux machines and has network drivers for Windows

operating systems.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.