2018-10-02 10:17:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-11-05 18:16:35 +00:00
|
|
|
# This script needs bridge-util debian package or similar
|
|
|
|
# for other distros.
|
|
|
|
|
|
|
|
# Run using "source setup-tapif" to get exported PRECONFIGURED_TAPIF variable
|
2018-10-02 10:17:31 +00:00
|
|
|
# Alternatively, add "export PRECONFIGURED_TAPIF=tap0" to ~/.bashrc
|
|
|
|
|
|
|
|
# http://backreference.org/2010/03/26/tuntap-interface-tutorial/
|
|
|
|
|
2018-11-05 18:16:35 +00:00
|
|
|
# After executing this script, start example_app.
|
|
|
|
# Enter 192.168.1.200 or "http://lwip.local/" (Zeroconf)
|
|
|
|
# in your webbrowser to see example_app webpage.
|
2018-10-02 10:17:31 +00:00
|
|
|
|
2024-03-24 11:52:34 +00:00
|
|
|
# N.b. you must disable USE_DHCP and USE_AUTOIP in lwipcfg.h for the static
|
|
|
|
# ip 192.168.1.200 to work in tapif
|
|
|
|
|
2018-10-02 10:17:31 +00:00
|
|
|
export PRECONFIGURED_TAPIF=tap0
|
2018-11-04 07:59:41 +00:00
|
|
|
|
|
|
|
sudo ip tuntap add dev $PRECONFIGURED_TAPIF mode tap user `whoami`
|
|
|
|
sudo ip link set $PRECONFIGURED_TAPIF up
|
|
|
|
sudo brctl addbr lwipbridge
|
|
|
|
sudo brctl addif lwipbridge $PRECONFIGURED_TAPIF
|
|
|
|
sudo ip addr add 192.168.1.1/24 dev lwipbridge
|
|
|
|
sudo ip link set dev lwipbridge up
|