udptunnel
udptunnel copied to clipboard
Is this because my server has no tun module loaded in kernel ?
See this screenshot, left side is server, right side is client.

It's not clear to me that this has anything to do with the kernel module loaded.
On a machine where udptunnel works properly, I get the same error:
rawr@obsidian: ~ $ cat /dev/net/tun
cat: /dev/net/tun: File descriptor in bad state
Your situation is a bit confusing since it seems that you have both the client and server machine named "chip".
You can test if the server tunnel is at least working:
- Running
ping 10.0.0.2in a terminal on the machine running in server mode. Let it send a few packets. - Stop
udptunnelfor the server and check the log output:
2018/03/05 12:23:19 main.go:164: loaded config:
{
"TunnelDevice": "",
"TunnelAddress": "10.0.0.1",
"TunnelPeerAddress": "",
"NetworkAddress": ":12345",
"AllowedPorts": [22],
"BinarySHA256": "5b6a1fdbcac0eeeaf7edf4d68028efd70254e2b59bda761ffcd4c8fa58da16c4"
}
2018/03/05 12:23:19 main.go:223: udptunnel starting in server mode
2018/03/05 12:23:19 tunnel.go:76: created tun device: tun0
^C2018/03/05 12:23:39 main.go:217: received interrupt - initiating shutdown
2018/03/05 12:23:39 logger.go:151: Packet statistics (20s):
Rx 0 total packets (0B), dropped 0 total packets (0B)
Tx 0 total packets (0B), dropped 3 total packets (252B)
IPv4/ICMP 10.0.0.1 -> 10.0.0.2 - Tx 3 dropped packets (252B)
2018/03/05 12:23:40 main.go:229: udptunnel shutdown
Here you see that it tried to send 3 ping packets, but failed (cause there is no client). However, this does provide conclusive proof whether the TUN device is working. If TUN is working, then it's an issue of transporting these packets over UDP.
Maybe that's because tun module problem.
I moved to another box and succeed , in LAN.
I'll try it from behind a firewall to outside.
How to write multiple allowed ports?
[22, 80, 2022] In this form ?
And how can I write configurations when I mapping ports on the firewall,
internal_ip:22 -> public_ip:2022

Seems like it didn't work on some complex ISP networks.
I'll try more scenarios.
How to write multiple allowed ports?
The AllowedPorts option only applies to the the virtual private network and should have no correlation with your external firewall settings.