If I understand correctly, you're looking for a way to link serial ports on two different hosts across the Internet, where both hosts are behind NAT. In that case, there are two different problems to solve:
- the two hosts need to be linked somehow, as there is no direct path between two systems behind different NAT endpoints
- the serial ports must somehow be linked across the network
The first problem can be solved by forwarding a port from the router to the host at one end, and set up tunneling/VPN. Plain IPsec in transport mode works well in scenarios like this (I can recommend the strongSwan
implementation), but I've heard a lot of good things about OpenVPN
If you really don't need/want enctyption, I guess you could use IP-in-IP or GRE tunneling
, but since both ends are behind NAT, it may actually be easier to set up a VPN connection; IPsec can work over a single forwarded UDP port while IPIP and GRE are separate IP protocols.
The second problem (linking the serial ports) can be done with socat
once a direct network connection is established.