• (OK)(OK) NS3



    -----------------------------------------------------------------
    install genymotion in Fedora23
    -----------------------------------------------------------------

    [root@localhost android-on-linux]# pwd
    /opt/android-on-linux
    [root@localhost android-on-linux]# ls genymotion-2.6.0-ubuntu15_x64.bin
    genymotion-2.6.0-ubuntu15_x64.bin

    [root@localhost android-on-linux]# chmod +x genymotion-2.6.0-ubuntu15_x64.bin
    [root@localhost android-on-linux]# ll -h genymotion-2.6.0-ubuntu15_x64.bin
    -rwxr-xr-x. 1 root root 41M 5月  18 22:54 genymotion-2.6.0-ubuntu15_x64.bin
    [root@localhost android-on-linux]# ./genymotion-2.6.0-ubuntu15_x64.bin
    Installing for all users.

    Installing to folder [/opt/genymobile/genymotion]. Are you sure [y/n] ? y


    - Trying to find VirtualBox toolset .................... OK (Valid version of VirtualBox found: 5.0.20r106931)
    - Extracting files ..................................... OK (Extract into: [/opt/genymobile/genymotion])
    - Installing launcher icon ............................. OK

    Installation done successfully.

    You can now use these tools from [/opt/genymobile/genymotion]:
     - genymotion
     - genymotion-shell
     - gmtool

    [root@localhost android-on-linux]#

    -----------------------------------------------------------------

    [root@localhost genymotion]# pwd
    /opt/genymobile/genymotion
    [root@localhost genymotion]# ./genymotion
    ./genymotion: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
    -----------------------------------------------------------------
    https://github.com/maciej-c/libjpeg8x64
    wget https://codeload.github.com/maciej-c/libjpeg8x64/zip/master

    [root@localhost libjpeg8-x64]# ll
    总用量 1176
    lrwxrwxrwx. 1 root root      16 5月  18 23:12 libjpeg.so.8 -> libjpeg.so.8.0.0
    -rwxrwxr-x. 1 root root 1188344 2月  12 02:23 libjpeg.so.8.0.0
    [root@localhost libjpeg8-x64]# cp -a libjpeg.so.8* /usr/lib64/
    -----------------------------------------------------------------

    [root@localhost genymotion]# pwd
    /opt/genymobile/genymotion

    [root@localhost genymotion]# ./genymotion

    -----------------------------------------------------------------

    [root@localhost ~]# pwd
    /opt/android-on-linux/android-sdk-linux/platform-tools

    [root@localhost ~]# gedit /root/.bashrc
    export PATH=$PATH:/opt/android-on-linux/android-sdk-linux/platform-tools

    [root@localhost ~]# adb shell
    root@vbox86p:/ # netcfg

    netcfg eth0 up
    netcfg eth0 dhcp

    -----------------------------------------------------------------
    So far, we have installed genymotion successfully.
    -----------------------------------------------------------------



    ------------------------------------------------------------------------------------------
    Fedora23 + genymotion (android) + NS3 + MANETs - testing
    ------------------------------------------------------------------------------------------

    ----------------------------
    first:
    ----------------------------
    [root@localhost ~]#

    brctl addbr br_a_1
    brctl addbr br_a_2

    tunctl -t tap_a_1
    tunctl -t tap_a_2

    ifconfig tap_a_1 0.0.0.0 promisc up
    ifconfig tap_a_2 0.0.0.0 promisc up

    brctl addif br_a_1 tap_a_1
    ifconfig br_a_1 up
    brctl addif br_a_2 tap_a_2
    ifconfig br_a_2 up

    ----------------------
    //You will also have to make sure that your kernel has ethernet filtering (ebtables, bridge-nf, arptables) disabled. If you do not do this, only STP and ARP traffic will be allowed to flow across your bridge and your whole scenario will not work.

    [root@localhost ~]#

    cd /proc/sys/net/bridge
    for f in bridge-nf-*; do echo 0 > $f; done
    cd -

    ----------------------------
    second:
    ----------------------------
    to set up the first genymotion VM in VirtualBox.
     ---> Virtual Box > (Custom Phone-5.1.0-API 22-768x1280) > Settings > Network > Adapter 2 > bridge, br_a_1,

    to set up the second genymotion VM in VirtualBox.
     ---> Virtual Box > (Google Nexus7-5.0.0-API 21-800x1280) > Settings > Network > Adapter 2 > bridge, br_a_2,

    [root@localhost genymotion]# pwd
    /opt/genymobile/genymotion
    [root@localhost genymotion]# ./genymotion

    to start the first android (Custom Phone-5.1.0-API 22-768x1280) in genymotion window.
    to start the second android (Google Nexus7-5.0.0-API 21-800x1280) in genymotion window.

    ----------------------------
    third:
    ----------------------------

    [root@localhost ~]# adb devices
    List of devices attached
    192.168.58.102:5555    device
    192.168.58.101:5555    device

    [root@localhost 111]#
    adb -s 192.168.58.101:5555 root
    adb -s 192.168.58.101:5555 shell
    netcfg
    // netcfg eth0 up
    // netcfg eth0 dhcp
    ip addr add 172.17.0.1/16 dev eth1
    ping 172.17.0.1
    ping 172.17.0.2

    [root@localhost 222]#
    adb -s 192.168.58.102:5555 root
    adb -s 192.168.58.102:5555 shell
    ip addr add 172.17.0.2/16 dev eth1
    netcfg
    // netcfg eth0 up
    // netcfg eth0 dhcp
    ping 172.17.0.1
    ping 172.17.0.2

    --------------------------------------
    172.17.0.2 can not ping 172.17.0.1
    --------------------------------------

    cp manet-2015.cc /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25/scratch/

    [root@localhost ns-3.25]# pwd
    /opt/tools/network_simulators/ns3/ns-allinone-3.25/ns-3.25
    [root@localhost ns-3.25]#

    ./waf --run manet-genymotion --vis


    ------------------------------------------------------------------------------------------
    172.17.0.2 can ping 172.17.0.1 successfully
    ------------------------------------------------------------------------------------------

    ------------------------------------------------------------------------------------------
    clean
    ------------------------------------------------------------------------------------------
    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

    ------------------------------------------------------------------------------------------
    So far, OK OK OK
    ------------------------------------------------------------------------------------------

  • 相关阅读:
    Android成长之路-LayoutInflater和inflate的用法
    Android成长之路-实现简单动画
    Android成长之路-编码实现软件界面
    Android成长之路-手势库的创建
    Android成长之路-手势识别的实现
    Android编程获取网络连接状态(3G/Wifi)及调用网络配置界面
    android中文字中间有超链接的实现方法
    Arduino可穿戴教程ArduinoIDE新建编辑源文件
    FMDB使用SQLite事务Save Point
    FMDB使用Cached Statement功能
  • 原文地址:https://www.cnblogs.com/ztguang/p/12646302.html
Copyright © 2020-2023  润新知