/tcpinuserspace

Just a funsite. Learning some rust

Primary LanguageRust

tcp in rust; in userspace

Just a bit of fun to learn Rust.

References

Debug tools

sudo apt install tshark

# monitor our interface
sudo tshark -i tun0

Quick Play

./run.sh

Send packets to some address on our interface

ping -I tun0 192.168.0.2

Manual approach

Set capabilities

sudo setcap CAP_NET_ADMIN=eip $CARGO_TARGET_DIR/release/tcpinuserspace

Run binary

$CARGO_TARGET_DIR/release/tcpinuserspace

Check devices

# look for tun0
ip addr

Set address

sudo ip addr add 192.168.0.1/24 dev tun0
# recheck tun0
ip addr

Bring it up

sudo ip link set dev tun0