All Projects → rapidloop → Vlan Nats

rapidloop / Vlan Nats

Licence: apache-2.0
Virtual LAN over NATS

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Vlan Nats

Zat
Zeek Analysis Tools (ZAT): Processing and analysis of Zeek network data with Pandas, scikit-learn, Kafka and Spark
Stars: ✭ 303 (-13.43%)
Mutual labels:  networking
Gokit
Go Examples: From basics to distributed systems
Stars: ✭ 325 (-7.14%)
Mutual labels:  nats
Exscript
A Python module making Telnet and SSH easy
Stars: ✭ 337 (-3.71%)
Mutual labels:  networking
Poseidon
Poseidon is a python-based application that leverages software defined networks (SDN) to acquire and then feed network traffic to a number of machine learning techniques. The machine learning algorithms classify and predict the type of device.
Stars: ✭ 310 (-11.43%)
Mutual labels:  networking
Nats.go
Golang client for NATS, the cloud native messaging system.
Stars: ✭ 3,690 (+954.29%)
Mutual labels:  nats
Cni
Container Network Interface - networking for Linux containers
Stars: ✭ 3,907 (+1016.29%)
Mutual labels:  networking
Portspider
🕷 A lightning fast multithreaded network scanner framework with modules.
Stars: ✭ 300 (-14.29%)
Mutual labels:  networking
Cellnet
High performance, simple, extensible golang open source network library
Stars: ✭ 3,714 (+961.14%)
Mutual labels:  networking
Wg Meshconf
WireGuard full mesh configuration generator.
Stars: ✭ 319 (-8.86%)
Mutual labels:  networking
Nsot
Network Source of Truth is an open source IPAM and network inventory database
Stars: ✭ 337 (-3.71%)
Mutual labels:  networking
Web Udp Public
Public demand for Web UDP
Stars: ✭ 312 (-10.86%)
Mutual labels:  networking
Dotnetty
DotNetty project – a port of netty, event-driven asynchronous network application framework
Stars: ✭ 3,422 (+877.71%)
Mutual labels:  networking
Libuv
Cross-platform asynchronous I/O
Stars: ✭ 18,615 (+5218.57%)
Mutual labels:  networking
Wgctrl Go
Package wgctrl enables control of WireGuard interfaces on multiple platforms.
Stars: ✭ 301 (-14%)
Mutual labels:  networking
Natsboard
Dashboard for monitoring NATS (an open source messaging system)
Stars: ✭ 339 (-3.14%)
Mutual labels:  nats
Pigeon
Async state management for SwiftUI (and UIKit) 🐦
Stars: ✭ 301 (-14%)
Mutual labels:  networking
Nats.java
Java client for NATS
Stars: ✭ 325 (-7.14%)
Mutual labels:  nats
Vault
swiss army knife for hackers
Stars: ✭ 346 (-1.14%)
Mutual labels:  networking
Handy
🔥简洁易用的C++11网络库 / 支持单机千万并发连接 / a simple C++11 network server framework
Stars: ✭ 3,815 (+990%)
Mutual labels:  networking
Colyseus
⚔ Multiplayer Framework for Node.js
Stars: ✭ 3,817 (+990.57%)
Mutual labels:  networking

vlan-nats

Disclaimer: This is only a fun experiment. Do not use it for anything serious.

vlan-nats creates a virtual LAN using NATS. Backed by a NATS server (or cluster), vlan-nats can create and run a network interface that is connected to a virtual L2 switch.

vlan-nats is written in entirely in Go. Currently, it works only on Linux. Multicast is not supported.

First, get and build vlan-nats:

$ go get github.com/rapidloop/vlan-nats

Then, on each machine, do:

sudo vlan-nats -n nats://{MY-NATS-SERVER}:4222 &
sudo ip addr add 10.1.0.{CHANGEME} broadcast 10.1.255.255 dev vnats0
sudo ip link set vnats0 up
sudo ip route add 10.1.0.0/16 dev vnats0

You should replace {CHANGEME} with a unique number. The {MY-NATS-SERVER} is the IP or host of a reachable NATS server (all machines must connect to the same NATS cluster).

Congratulations! You now have all your machines reachable on the virtual subnet 10.1.0.0/16. You should be able to ping each other:

$ ip a show vnats0
7: vnats0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 7e:8f:d4:17:2b:0c brd ff:ff:ff:ff:ff:ff
    inet 10.1.0.1/32 brd 10.1.255.255 scope global vnats0
       valid_lft forever preferred_lft forever
    inet6 fe80::7c8f:d4ff:fe17:2b0c/64 scope link tentative dadfailed
       valid_lft forever preferred_lft forever
$ ping 10.1.0.2
PING 10.1.0.2 (10.1.0.2) 56(84) bytes of data.
64 bytes from 10.1.0.2: icmp_seq=1 ttl=64 time=1.70 ms
64 bytes from 10.1.0.2: icmp_seq=2 ttl=64 time=1.60 ms
^C
--- 10.1.0.2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1003ms
rtt min/avg/max/mdev = 1.603/1.654/1.706/0.065 ms
$

Cool!

To cleanup, just sudo pkill vlan-nats. The interface is not persisted.

How It Works

vlan-nats creates a TAP interface. All broadcast frames from the interface are published to the NATS topic vlan.{ID} and unicast frames are published to vlan.{ID}.{DST_ETHADDR}. The process subscribes to vlan.{ID} and vlan.{ID}.{OWN_ETHADDR} and writes out any received frames into the TAP interface.

Windows and OS X do not natively support TAP devices, but (free) 3rd party drivers are available.

Things To Try Out

  • Windows and OS X can be supported with 3rd party TAP drivers.
  • Run a DHCP server instead of assigning static IPs.
  • Use a TLS-enabled, authenticated, public NATS server -- like a VPN!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].