(OK)(OK)(All in CLI) running two Android-x86 which connect to NS3(MANETs) via "ethernet bridge"
#--------------------------------------------------------------------------
# (OK)(OK)(All in CLI) running two Android-x86 which connect to NS3(MANETs) via "ethernet bridge"
#--------------------------------------------------------------------------
#-----------
# in HOST
#-----------
tunctl -t tap_a_1
ip link set up dev tap_a_1
brctl addbr br_a_1
brctl addif br_a_1 tap_a_1
ip link set up dev br_a_1
ifconfig br_a_1 up
# ip addr add 10.1.1.1/24 dev br_a_1
# ip route add 10.1.1.0/24 dev br_a_1
#-----------
tunctl -t tap_a_2
ip link set up dev tap_a_2
brctl addbr br_a_2
brctl addif br_a_2 tap_a_2
ip link set up dev br_a_2
ifconfig br_a_2 up
# ip addr add 10.1.1.2/24 dev br_a_2
# ip route add 10.1.1.0/24 dev br_a_2
#-----------
ifconfig br_a_1 down
brctl delif br_a_1 tap_a_1
brctl delbr br_a_1
ifconfig tap_a_1 down
tunctl -d tap_a_1
ifconfig br_a_2 down
brctl delif br_a_2 tap_a_2
brctl delbr br_a_2
ifconfig tap_a_2 down
tunctl -d tap_a_2
# adb devices
# adb root
# adb -s 192.168.56.101:5555 shell
VBoxManage modifyvm android-x86-6.0-rc1-1 --memory 1024 --nic1 hostonly --nictype1 Am79C973 --hostonlyadapter1 vboxnet0 --nic2 bridged --bridgeadapter2 br_a_1
VBoxManage startvm android-x86-6.0-rc1-1
sleep 30
adb connect 192.168.56.101
sleep 1
adb -s 192.168.56.101:5555 root
sleep 1
adb connect 192.168.56.101
sleep 1
adb -s 192.168.56.101:5555 root
sleep 1
adb connect 192.168.56.101
adb -s 192.168.56.101:5555 shell ifconfig eth1 down
adb -s 192.168.56.101:5555 shell ifconfig eth1 10.1.1.10 netmask 255.255.255.0 up
adb -s 192.168.56.101:5555 shell ifconfig eth0 down
# VBoxManage controlvm android-x86-6.0-rc1-1 poweroff
VBoxManage modifyvm android-x86-6.0-rc1-2 --memory 1024 --nic1 hostonly --nictype1 Am79C973 --hostonlyadapter1 vboxnet0 --nic2 bridged --bridgeadapter2 br_a_2
VBoxManage startvm android-x86-6.0-rc1-2
sleep 30
adb connect 192.168.56.102
sleep 1
adb -s 192.168.56.102:5555 root
sleep 1
adb connect 192.168.56.102
sleep 1
adb -s 192.168.56.102:5555 root
sleep 1
adb connect 192.168.56.102
adb -s 192.168.56.102:5555 shell ifconfig eth1 down
adb -s 192.168.56.102:5555 shell ifconfig eth1 10.1.1.20 netmask 255.255.255.0 up
adb -s 192.168.56.102:5555 shell ifconfig eth0 down
# VBoxManage controlvm android-x86-6.0-rc1-2 poweroff
#-----------------------
# running NS3
#-----------------------
[root@localhost ~]# cd /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
[root@localhost ns-3.25]# gedit scratch/manet-docker.cc
#----------------
TapBridgeHelper tapBridge;
tapBridge.SetAttribute ("Mode", StringValue ("UseLocal"));
tapBridge.SetAttribute ("DeviceName", StringValue ("tap_a_1"));
tapBridge.Install (nodes.Get (0), devices.Get (0));
tapBridge.SetAttribute ("DeviceName", StringValue ("tap_a_2"));
tapBridge.Install (nodes.Get (1), devices.Get (1));
#----------------
[root@localhost ns-3.25]# ./waf --run scratch/manet-docker --vis