[ALUG] Mapping a local IP to a remote one

Steve Engledow steve at offend.me.uk
Tue May 26 12:26:49 BST 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

If it's just for this thing then you could simply set up an ssh tunnel
on your PC.

    ssh -N -L 0.0.0.0:8888:127.0.0.1:1234 user at 192.168.2.100

Something like that would map port 8888 on your PC to port 1234 of the remote box.

Though that requires the remote thing to be running ssh. If it isn't,
you could socat. My socat-fu is weak and it's been a while since I've
used it but possibly something like:

    socat TCP-LISTEN:8888 TCP:192.168.2.100:1234

Steve

On 26/05, Mark Rogers wrote:
> I'm sure that if I could make a decent job of explaining what I mean I
> could Google for this but...
> 
> My PC is (say) 192.168.1.10, and it can access a remote device
> (192.168.2.100) via a VPN.
> 
> What I want to do is give my PC an extra IP address (eg 192.168.1.11)
> and map all network traffic to that IP address (on any port, and
> including broadcast traffic) to 192.168.2.100, and send any responses
> back.
> 
> In doing so, any other PC on my LAN would be able to access the remote
> device as if it were local (192.168.1.11).
> 
> Can I do this?
> 
> (Background: In this case I have some brain-dead Windows configuration
> software that can only talk to devices on the LAN, so I need to make
> the remote device appear as if it were on the LAN. However I have had
> similar challenges in the past where using a local Linux box as a
> conduit to remote devices would have been useful.)
> 
> If relevant, whilst 192.168.2.100 is not a Linux PC (it's an
> industrial I/O unit), I do have a Linux PC on the remote network that
> could form part of the tunnel if required. The key point is that I
> need the remote unit to appear to be on the local network, not just to
> be accessible from it. My Windows PC can ping (etc) the remote unit
> fine via the VPN itself, but the configuration software will only
> search for and work with devices on 192.168.1.0/24, so I need to fake
> it.
> 
> -- 
> Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
> Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
> 
> _______________________________________________
> main at lists.alug.org.uk
> http://www.alug.org.uk/
> http://lists.alug.org.uk/mailman/listinfo/main
> Unsubscribe?  See message headers or the web site above!
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJVZFh5AAoJEL/3HArzwYbR+UoP/A88XnL66DgQwfhw9tpQVAXn
w5ezFU7wxH/SBJ7ZxgXBgEAorCvmMNFwFVzOgGmb/fSW2VdrFcjBbAwbNskDxmpa
uYSjkJHQAEYLh3pudkw9wqA1kPC+gLmsFoumnwiTNEXDa1GYk/Vc73b/A5eTFhCt
yPzyT5cdkdWLJHCRJkyPbkLEyDZ/E6rULoeYassjDW50d1occML2blyq7uwy2V6x
nlsMQNSIACt20u67RcDrgUQAMrILjg0jmXtZrgqlEPstHfefr44OGwHmLtUAHbky
VaJF+8Vwa76j/NbIJ3GVg+WKnHyujQMJlrLs/nGsZonB1td5Ny1WzyxIyemJq42L
iF0viLLj3LUzaefydJEod0xMniPIk6Foxt3d2/hbozEvhaavH2VyoqHnMEtjHJc9
hF+sEaLq/jeIEOIzclrMt+3LcpOetynXyg3jM+uOFUCICP5S5WtpD1W+KBdDAGA/
qRFEiAkc0LoPeYv2qZWL/o5lokw/FVDteVFpigSsTtJdEgJdDOKPZ5rIUVbTZruu
DRXvSDpn1c+lX1G+Za4dGgeU/07liJV9NYuG56/QMKTCJiHJzUD8IrjygG8omCdW
kQEJFyVBzzP7nIYYW4S3mGWeCA4BJsdiKkZcq3pGvKCf9A11Q/d8Gw1uGUUEabfM
ulIvVqV5HebGrhX2xsIR
=535f
-----END PGP SIGNATURE-----



More information about the main mailing list