-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix issues of scion-setup steps (#72)
- Loading branch information
Showing
2 changed files
with
18 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
#!/bin/bash | ||
|
||
VM_ADDRESS=$(multipass info scion | awk '/IPv4/{print $2}') | ||
ssh ubuntu@$VM_ADDRESS << 'EOF' | ||
export PATH=/home/ubuntu/.local/bin/:$PATH | ||
cd scion | ||
./scion.sh topology -c topology/tiny.topo | ||
./scion.sh run | ||
EXTERNAL_ADDRESS=$(ip route get 9.9.9.9 | sed "s/.*src \([^ ]*\).*/\1/;t;d") | ||
DAEMON_ADDRESS_111=$(cat gen/sciond_addresses.json | jq -r ".\"1-ff00:0:111\"") | ||
sudo iptables -t nat -I PREROUTING \ | ||
-d $EXTERNAL_ADDRESS -p tcp --match multiport --dports 30000:32000 \ | ||
-j DNAT --to $DAEMON_ADDRESS_111 | ||
EOF | ||
DAEMON_PORT=$(ssh ubuntu@$VM_ADDRESS 'cd scion; ./scion.sh sciond-addr 111 | cut -d ":" -f 2') | ||
export SCION_DISPATCHER_SOCKET=/tmp/dispatcher.sock | ||
export DAEMON_ADDRESS="[$VM_ADDRESS]:$DAEMON_PORT" | ||
rm $SCION_DISPATCHER_SOCKET | ||
rm -f $SCION_DISPATCHER_SOCKET | ||
ssh ubuntu@$VM_ADDRESS -fN -L $SCION_DISPATCHER_SOCKET:/run/shm/dispatcher/default.sock |