alexchan
Would like to create a virtual ethernet for multiple nodes via OpenVPN.
As a simple example, I have one server node A 1.0.0.1, and the other node B 2.0.0.2
My server.conf is:
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
The my client.conf is:
remote 1.0.0.1
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret static.key
I start the server using "sudo openvpn server.conf" and start the client using "sudo openvpn client.conf"
A tunnel can be created, according to ifconfig:
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
If I use ping from node A to node B, it's feasible. However, if I would to deliver some non-IP packets (e.g., ehternet frames) from A to B, it results:
Tue Mar 19 13:27:34 2013 write to TUN/TAP : Invalid argument (code=22)
Tue Mar 19 13:27:34 2013 write to TUN/TAP : Invalid argument (code=22)
Tue Mar 19 13:27:34 2013 write to TUN/TAP : Invalid argument (code=22)
Tue Mar 19 13:27:34 2013 write to TUN/TAP : Invalid argument (code=22)
Tue Mar 19 13:27:34 2013 write to TUN/TAP : Invalid argument (code=22)
It seems that the openvpn in node B has found that it's not an IP packet, and discard it.
Is it possible to disable this auto checking in OpenVPN? Thanks a lot!