5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-29 02:51:37 +00:00
yggdrasil-go/misc/run-conf2-netns

24 lines
887 B
Plaintext
Raw Normal View History

2017-12-29 04:16:20 +00:00
#!/bin/sh
ip netns add peerns
ip link add veth0 type veth peer name veth1
ifconfig veth0 192.168.2.1/24 up
echo "1"
#tc qdisc add dev veth0 root tbf rate 8mbit burst 8192 latency 1ms
#tc qdisc add dev veth0 root netem delay 50ms 5ms distribution normal
echo "2"
ip link set veth1 netns peerns
ip netns exec peerns ifconfig veth1 192.168.2.2/24 up
echo "3"
#ip netns exec peerns tc qdisc add dev veth1 root tbf rate 8mbit burst 8192 latency 1ms
#ip netns exec peerns tc qdisc add dev veth1 root netem delay 50ms 5ms distribution normal
echo "4"
ip netns exec peerns ip addr list
#ip netns exec peerns ./run -useconf=conf2.json
ip netns exec peerns ip link set dev lo up
ip netns exec peerns ./run -autoconf -pprof
#GODEBUG=gctrace=1 ip netns exec peerns ./run -autoconf
#ip netns exec peerns ./run -useconf=conf2.json -cpuprofile=cpu2.prof -memprofile=mem2.prof
#ip netns delete peerns