modified examples/std README to avoid possible problems

This commit is contained in:
Bart Massey 2024-12-31 14:27:41 -08:00
parent 667dfa34b5
commit 6b3ca67763
2 changed files with 12 additions and 9 deletions

View File

@ -1,16 +1,12 @@
## Running the `embassy-net` examples ## Running the `embassy-net` examples
First, create the tap0 interface. You only need to do this once. First, create the tap99 interface. (The number was chosen to
hopefully not collide with anything.) You only need to do
this once.
```sh ```sh
sudo ip tuntap add name tap0 mode tap user $USER sudo sh tap.sh
sudo ip link set tap0 up
sudo ip addr add 192.168.69.100/24 dev tap0
sudo ip -6 addr add fe80::100/64 dev tap0
sudo ip -6 addr add fdaa::100/64 dev tap0
sudo ip -6 route add fe80::/64 dev tap0
sudo ip -6 route add fdaa::/64 dev tap0
``` ```
Second, have something listening there. For example `nc -lp 8000` Second, have something listening there. For example `nc -lp 8000`
@ -19,5 +15,5 @@ Then run the example located in the `examples` folder:
```sh ```sh
cd $EMBASSY_ROOT/examples/std/ cd $EMBASSY_ROOT/examples/std/
cargo run --bin net -- --static-ip sudo cargo run --bin net -- --tap tap99 --static-ip
``` ```

7
examples/std/tap.sh Normal file
View File

@ -0,0 +1,7 @@
ip tuntap add name tap99 mode tap user $USER
ip link set tap99 up
ip addr add 192.168.69.100/24 dev tap99
ip -6 addr add fe80::100/64 dev tap99
ip -6 addr add fdaa::100/64 dev tap99
ip -6 route add fe80::/64 dev tap99
ip -6 route add fdaa::/64 dev tap99