diff options
author | Joe Crayne <joe@jerkface.net> | 2020-01-12 04:10:38 -0500 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-12 04:41:59 -0500 |
commit | f71f6139f4401474166a41b8918df7e29318c405 (patch) | |
tree | bdac89df06a3202a22013d7612dbf27331ad2f9d /dht/vnet/build.sh | |
parent | a7cc1e718b87240ef83e2c4abfd4f2efdd6a7e87 (diff) |
Scripts to run a toxcore DHT network on localhost.
Diffstat (limited to 'dht/vnet/build.sh')
-rwxr-xr-x | dht/vnet/build.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dht/vnet/build.sh b/dht/vnet/build.sh index 5354969a..7f7787f0 100755 --- a/dht/vnet/build.sh +++ b/dht/vnet/build.sh | |||
@@ -72,7 +72,9 @@ buildtaps() { | |||
72 | 72 | ||
73 | buildtaps | 73 | buildtaps |
74 | 74 | ||
75 | num=$(ip addr show wlan0 | sed -n '/\s\+inet 192/ s/\s\+inet 192\.168\.[0-9]*\.\([0-9]*\).*$/\1/ p') | 75 | iface=$(ip route | awk '/^default/{ if ($4 == "dev") print($5); }') |
76 | iface=${iface:-wlan0} | ||
77 | num=$(ip addr show $iface | sed -n '/\s\+inet 192/ s/\s\+inet 192\.168\.[0-9]*\.\([0-9]*\).*$/\1/ p') | ||
76 | num=${num:-88} | 78 | num=${num:-88} |
77 | 79 | ||
78 | ip addr add 80.$num.99.99 dev ep0 | 80 | ip addr add 80.$num.99.99 dev ep0 |