mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-09-29 07:10:54 +00:00
ed9dabe088
This took some figuring out, it might be obvious to those familiar with lwipcfg.h but for someone picking this up for the first time to experiment on linux, this helpful comment would have helped enormously.
26 lines
877 B
Bash
Executable File
26 lines
877 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# This script needs bridge-util debian package or similar
|
|
# for other distros.
|
|
|
|
# Run using "source setup-tapif" to get exported PRECONFIGURED_TAPIF variable
|
|
# Alternatively, add "export PRECONFIGURED_TAPIF=tap0" to ~/.bashrc
|
|
|
|
# http://backreference.org/2010/03/26/tuntap-interface-tutorial/
|
|
|
|
# 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.
|
|
|
|
# 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
|
|
|
|
export PRECONFIGURED_TAPIF=tap0
|
|
|
|
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
|