GVKun编程网logo

(OK) running imunes in Fedora 23

27

本文将带您了解关于(OK)runningimunesinFedora23的新内容,另外,我们还将为您提供关于(OK)installWINEinFedora23orLater、(OK)runningCO

本文将带您了解关于(OK) running imunes in Fedora 23的新内容,另外,我们还将为您提供关于(OK) install WINE in Fedora 23 or Later、(OK) running CORE—Common Open Research Emulator—docker、(OK) simply running CORE & docker on Fedora 23、(OK)(OK) Fedora23-NS3-Android-x86-MANETs-Testing的实用信息。

本文目录一览:

(OK) running imunes in Fedora 23

(OK) running imunes in Fedora 23

[root@localhost ~]# systemctl start docker

[root@localhost ~]# /usr/share/openvswitch/scripts/ovs-ctl start


+++++++++++++++++++++++++++++++++++++++

[root@localhost imunes]# grep ovs-appctl /var/log/audit/audit.log | audit2allow -M mypol
[root@localhost imunes]# semodule -i mypol.pp


https://github.com/imunes/imunes/issues/33


change the docker template uri to just "imunes/vroot:base" in prepare_vroot.sh

then

[root@localhost imunes]# imunes -p

[root@localhost imunes]# imunes

+++++++++++++++++++++++++++++++++++++++

ELinux is preventing ovs-appctl from ''read, write'' accesses on the file ovsdb-server.pid.

*****  Plugin catchall (100. confidence) suggests   **************************

If 您确定应默认允许 ovs-appctl read write 访问 ovsdb-server.pid file。
Then 您应该将这个情况作为 bug 报告。
您可以生成本地策略模块允许这个访问。
Do
请执行以下命令此时允许这个访问:
# grep ovs-appctl /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:openvswitch_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                ovsdb-server.pid [ file ]
Source                        ovs-appctl
Source Path                   ovs-appctl
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-152.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 4.2.3-300.fc23.x86_64
                              #1 SMP Mon Oct 5 15:42:54 UTC 2015 x86_64 x86_64
Alert Count                   1
First Seen                    2016-01-27 08:11:02 CST
Last Seen                     2016-01-27 08:11:02 CST
Local ID                      c605ec33-38c2-4da2-a705-e2f34268cfe6

Raw Audit Messages
type=AVC msg=audit(1453853462.215:579): avc:  denied  { read write } for  pid=5426 comm="ovs-appctl" name="ovsdb-server.pid" dev="tmpfs" ino=39174 scontext=system_u:system_r:openvswitch_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file permissive=0


Hash: ovs-appctl,openvswitch_t,var_run_t,file,read,write

+++++++++++++++++++++++++

# Fedora 22

    # dnf install openvswitch docker-io xterm wireshark-gnome ImageMagick tcl tcllib tk kernel-modules-extra util-linux

    # echo ''DOCKER_STORAGE_OPTIONS="-s overlay"'' >> /etc/sysconfig/docker-storage
    # systemctl restart docker

----------
    Arch:
    # cp /usr/lib/systemd/system/docker.service /etc/systemd/system/docker.service
    ### add overlay to ExecStart
    ExecStart=/usr/bin/docker daemon -s overlay -H fd://
    ### reload systemd files and restart docker.service
    # systemctl daemon-reload
    # systemctl restart docker

    Check status with docker info:
    # docker info | grep Storage
    Storage Driver: overlay
----------

### Installing IMUNES

Checkout the last fresh IMUNES source through the public github
repository:

    # dnf install git

    # git clone https://github.com/imunes/imunes.git

Now we need to install IMUNES and populate the virtual file system
with predefined and required data. To install imunes on the system
execute (as root):

    # cd imunes
    # make install

### Filesystem for virtual nodes

For the topologies to work a template filesystem must be created.
This is done by issuing the following command (as root):

    # imunes -p

Now the IMUNES GUI can be ran just by typing the imunes command
in the terminal:

    # imunes

To execute experiments, run it as root.

For additional information visit our web site:
        http://imunes.net/

(OK) install WINE in Fedora 23 or Later

(OK) install WINE in Fedora 23 or Later


------------------------------------------------------------------------------------
install WINE in Fedora 23 or Later
------------------------------------------------------------------------------------


dnf clean all
dnf upgrade


## Consider running this command (provided by Zhenbo, tested on Fedora 23)
## on Fedora 24, can not install libcapifax-devel.i686

dnf install alsa-plugins-pulseaudio.i686 glibc-devel.i686 glibc-devel libgcc.i686 libX11-devel.i686 freetype-devel.i686 libXcursor-devel.i686 libXi-devel.i686 libNX_Xext-devel.i686 libXext-devel.i686 libXxf86vm-devel.i686 libXrandr-devel.i686 libXinerama-devel.i686 mesa-libGLU-devel.i686 mesa-libOSMesa-devel.i686 libXrender-devel.i686 libpcap-devel.i686 ncurses-devel.i686 libzip-devel.i686 lcms2-devel.i686 zlib-devel.i686 libv4l-devel.i686 libgphoto2-devel.i686 libcapifax-devel.i686  cups-devel.i686 libxml2-devel.i686 openldap-devel.i686 libxslt-devel.i686 gnutls-devel.i686 libpng-devel.i686 flac-libs.i686 json-c.i686 libICE.i686 libSM.i686 libXtst.i686 libasyncns.i686 libedit.i686 liberation-narrow-fonts.noarch libieee1284.i686 libogg.i686 libsndfile.i686 libuuid.i686 libva.i686 libvorbis.i686 libwayland-client.i686 libwayland-server.i686 llvm-libs.i686 mesa-dri-drivers.i686 mesa-filesystem.i686 mesa-libEGL.i686 mesa-libgbm.i686 nss-mdns.i686 ocl-icd.i686 pulseaudio-libs.i686 python-talloc.x86_64 sane-backends-libs.i686 tcp_wrappers-libs.i686 unixODBC.i686 samba-common-tools.x86_64 samba-libs.x86_64 samba-winbind.x86_64 samba-winbind-clients.x86_64 samba-winbind-modules.x86_64 mesa-libGL-devel.i686 fontconfig-devel.i686 libXcomposite-devel.i686 libtiff-devel.i686 openal-soft-devel.i686 mesa-libOpenCL-devel.i686 opencl-utils-devel.i686 alsa-lib-devel.i686 gsm-devel.i686 libjpeg-turbo-devel.i686 pulseaudio-libs-devel.i686 pulseaudio-libs-devel gtk3-devel.i686 libattr-devel.i686 libva-devel.i686 libexif-devel.i686 libexif.i686 glib2-devel.i686

dnf groupinstall "C Development Tools and Libraries"
dnf groupinstall "Development Tools"

------------------------------------------------------------------------------------
Also, you need some packages from rpmfusion

dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
------------------------------------------------------------------------------------

dnf install libmpg123-devel.i686 gstreamer-plugins-base-devel gstreamer-devel.i686 gstreamer.i686 gstreamer-plugins-base.i686 gstreamer-devel gstreamer1.i686 gstreamer1-devel gstreamer1-plugins-base-devel.i686 gstreamer-plugins-base.x86_64 gstreamer.x86_64 gstreamer1-devel.i686 gstreamer1-plugins-base-devel gstreamer-plugins-base-devel.i686 gstreamer-ffmpeg.i686 gstreamer1-plugins-bad-free-devel.i686 gstreamer1-plugins-bad-free-extras.i686 gstreamer1-plugins-good-extras.i686 gstreamer1-libav.i686 gstreamer1-plugins-bad-freeworld.i686

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


dnf install libX11-devel freetype-devel zlib-devel libxcb-devel

wget https://dl.winehq.org/wine/source/1.9/wine-1.9.15.tar.bz2
tar xjf wine-1.9.15.tar.bz2

[root@localhost wine-1.9.15]# pwd
/opt/tools/wine-1.9.15

[root@localhost wine-1.9.15]#

## For 32-Bit Systems:
./configure

## For 64-Bit Systems:
./configure  --enable-win64

make -j5
make install

------------------------------
/usr/local/bin/wine*
/usr/local/include/wine/
/usr/local/lib/wine/
/usr/local/share/man/man1/wine*
------------------------------

## On 32-Bit Systems:
wine --version

## On 64-Bit Systems:
wine64 --version

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[root@localhost source-insight]# wine Source-Insight-3.5.exe 

wine: created the configuration directory ''/root/.wine''


(OK) running CORE—Common Open Research Emulator—docker

(OK) running CORE—Common Open Research Emulator—docker

-----------------------INSTALL quagga
http://blog.chinaunix.net/uid-14735472-id-5595972.html

core-manual.pdf

[root@localhost quagga-0.99.24]# pwd
/opt/tools/network_simulators/quagga-0.99.24

[root@localhost quagga-0.99.24]#
cp pimd/pimd.conf.sample  /usr/local/etc/quagga/pimd.conf
cp isisd/isisd.conf.sample  /usr/local/etc/quagga/isisd.conf
cp babeld/babeld.conf.sample  /usr/local/etc/quagga/babeld.conf
cp ospf6d/ospf6d.conf.sample  /usr/local/etc/quagga/ospf6d.conf
cp ospfd/ospfd.conf.sample  /usr/local/etc/quagga/ospfd.conf
cp ripngd/ripngd.conf.sample  /usr/local/etc/quagga/ripngd.conf
cp ripd/ripd.conf.sample  /usr/local/etc/quagga/ripd.conf
cp bgpd/bgpd.conf.sample  /usr/local/etc/quagga/bgpd.conf
cp zebra/zebra.conf.sample  /usr/local/etc/quagga/zebra.conf
cp vtysh/vtysh.conf.sample  /usr/local/etc/quagga/vtysh.conf

ln -s /usr/local/etc/quagga/pimd.conf /etc/quagga/pimd.conf
ln -s /usr/local/etc/quagga/isisd.conf /etc/quagga/isisd.conf
ln -s /usr/local/etc/quagga/babeld.conf /etc/quagga/babeld.conf
ln -s /usr/local/etc/quagga/ospf6d.conf /etc/quagga/ospf6d.conf
ln -s /usr/local/etc/quagga/ospfd.conf /etc/quagga/ospfd.conf
ln -s /usr/local/etc/quagga/ripngd.conf /etc/quagga/ripngd.conf
ln -s /usr/local/etc/quagga/ripd.conf /etc/quagga/ripd.conf
ln -s /usr/local/etc/quagga/bgpd.conf /etc/quagga/bgpd.conf
ln -s /usr/local/etc/quagga/zebra.conf /etc/quagga/zebra.conf
ln -s /usr/local/etc/quagga/vtysh.conf /etc/quagga/vtysh.conf

[root@localhost core-4.8]# cp /usr/local/etc/quagga/zebra.conf /usr/local/etc/quagga/Quagga.conf

+++++++++++++++++++++++++ install docker etc.

# Fedora 23

    # dnf install openvswitch docker-io xterm wireshark-gnome ImageMagick tcl tcllib tk kernel-modules-extra util-linux

    # echo ''DOCKER_STORAGE_OPTIONS="-s overlay"'' >> /etc/sysconfig/docker-storage
    # systemctl restart docker

----------
如果出现如下问题:
# systemctl start docker
Job for docker.service failed. See ''systemctl status docker.service'' and ''journalctl -xn'' for details.
解决方法:
# rm /var/lib/docker -rf
# systemctl daemon-reload
# systemctl start docker

// 下面两条命令不用
# dnf remove docker
# dnf install docker
----------

----------
    Arch:
    # cp /usr/lib/systemd/system/docker.service /etc/systemd/system/docker.service
    ### add overlay to ExecStart
    ExecStart=/usr/bin/docker daemon -s overlay -H fd://
    ### reload systemd files and restart docker.service
    # systemctl daemon-reload
    # systemctl restart docker

    Check status with docker info:
    # docker info | grep Storage
    Storage Driver: overlay
----------

http://stackoverflow.com/questions/20994863/how-to-use-docker-or-linux-containers-for-network-emulation

<span style="font-size:18px;">
    CORE Network Emulator does have a Docker Service that I contributed and wrote an article about. The initial version that is in 4.8 is mostly broken but I have fixed and improved it. A pull request is on GitHub.

    The service allows you to tag Docker Images with ''core'' and then they appear as an option in the services settings. You must select the Docker image which starts the docker service in the container. You then select the container or containers that you want to run in that node. It scales quite well and I have had over 2000 nodes on my 16Gb machine.

    You mentioned OVS as well. This is not yet built in to CORE but can be used manually. I just answered a question on the CORE mailing list on this. It gives a brief overview of switching out a standard CORE switch(bridge) with OVS. Text reproduced below if it is useful:

</span>

+++++++++++++++++++++++++++++
[root@localhost quagga]# ll
总用量 6612
-rw-r--r--.  1 root root 2471193 1 月  13 21:57 quagga-0.99.21mr2.2.tar.gz
-rw-r--r--.  1 root root 1680796 1 月  12 15:36 quagga-0.99.24.tar.xz
-rw-r--r--.  1 root root 2560375 1 月  14 14:27 quagga-svnsnap.tgz  // 最新版
[root@localhost quagga]#


-------------------Fedora 23, Installing Quagga

# tar xzf quagga-svnsnap.tgz
# cd quagga
[root@localhost quagga]# ./bootstrap.sh
[root@localhost quagga]# ./configure --enable-user=root --enable-group=root --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh --localstatedir=/var/run/quagga

// copy basic.texi, ipv6.texi in quagga-0.99.24/doc   to   quagga-0.99.21mr2.2/doc
[root@localhost quagga]# cp ../quagga-0.99.24/doc/basic.texi ../quagga-0.99.24/doc/ipv6.texi doc/

[root@localhost quagga]# make -j4
[root@localhost quagga]# make install
[root@localhost quagga]# systemctl cat zebra.service

[root@localhost quagga]# systemctl start zebra.service
Job for zebra.service failed because a configured resource limit was exceeded. See "systemctl status zebra.service" and "journalctl -xe" for details.
[root@localhost quagga]# mkdir /run/quagga/

[root@localhost quagga]# systemctl start zebra.service
[root@localhost quagga]# systemctl status zebra.service
[root@localhost quagga]# systemctl stop zebra.service

[root@localhost quagga]# vtysh
[root@localhost quagga]# telnet localhost 2601

+++++++++++++++++++++++++++++

[root@localhost core]# systemctl start squid.service
[root@localhost core]# systemctl status squid.service

+++++++++++++++++++++++++++++

# tar xzf core-network_4.8.orig.tar.gz
# cd core-4.8

-----------------------INSTALL CORE --- OK OK

Fedora 23:

dnf install bash bridge-utils ebtables iproute libev python procps-ng net-tools tcl tk tkimg autoconf automake make libev-devel python-devel ImageMagick help2man


// 重要,在 CORE 中,执行 /root/.core/configs/m-MPE-manet.imn,不能正常初始化。需要执行如下命令。

//  http://blog.csdn.net/ztguang/article/details/51262543

dnf install kernel-modules-extra-`uname -r`

CentOS 7:
yum install bash bridge-utils ebtables iproute libev python procps-ng net-tools tcl tk tkimg autoconf automake make libev-devel python-devel ImageMagick help2man


You can obtain the CORE source from the CORE source page. Choose either a stable release version orthe development snapshot available in thenightly_snapshots directory.The -j8 argument tomake will run eight simultaneous jobs, to speed upbuilds on multi-core systems. Notice theconfigure flag to tell the buildsystem that a systemd service file should be installed under Fedora.

[root@localhost core-4.8]# ./bootstrap.sh
[root@localhost core-4.8]# ./configure --with-startup=systemd
[root@localhost core-4.8]# make -j4
[root@localhost core-4.8]# make install

Note that the Linux RPM and Debian packages do not use the/usr/local prefix, and files are instead installed to /usr/sbin, and /usr/lib. This difference is a result of aligning with the directorystructure of Linux packaging systems and FreeBSD ports packaging.

Another note is that the Python distutils in Fedora Linux will install the COREPython modules to/usr/lib/python2.7/site-packages/core, instead ofusing thedist-packages directory.

The CORE Manual documentation is built separately from thedoc/ sub-directory in the source. It requires Sphinx:

sudo yum install python-sphinx
cd core-4.8/doc
make html
make latexpdf
-----------------------INSTALL CORE --- OK OK



-----------------------Test CORE

To test that the CORE Network Emulator is working, start the CORE daemon and the GUI.

[root@localhost core-4.8]# pwd
/opt/tools/network_simulators/core/core-4.8

[root@localhost core-4.8]# /etc/init.d/core-daemon start
[root@localhost core-4.8]# core-gui

[root@localhost core-4.8]# ls /tmp/pycore.56386/
n1                    n1.xy                 n3.pid                n5.log                n7.conf/              n9
n10                   n2                    n3.xy                 n5.pid                n7.log                n9.conf/
n10.conf/             n2.conf/              n4                    n5.xy                 n7.pid                n9.log
n10.log               n2.log                n4.conf/              n6                    n7.xy                 n9.pid
n10.pid               n2.pid                n4.log                n6.conf/              n8                    n9.xy
n10.xy                n2.xy                 n4.pid                n6.log                n8.conf/              nodes
n1.conf/              n3                    n4.xy                 n6.pid                n8.log                servers
n1.log                n3.conf/              n5                    n6.xy                 n8.pid                session-deployed.xml
n1.pid                n3.log                n5.conf/              n7                    n8.xy                 state

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
关键点
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

core-svnsnap.tgz

[root@localhost core]# pwd
/opt/tools/network_simulators/core/core

[root@localhost core]# gedit ./daemon/core/mobility.py
------------------------------------- 设置节点移动的时间间隔
    def runround(self):
        '''''' Advance script time and move nodes.
        ''''''
        #ztg add
        time.sleep(6)
------------------------------------- 设置节点移动的间距
        #ztg add
        #wp = self.WayPoint(time, nodenum, coords=(x,y,z), speed=speed)
        wp = self.WayPoint(time, nodenum, coords=(x,y,z), speed=3)
-------------------------------------
[root@localhost core]# systemctl start squid.service
[root@localhost core]# systemctl start docker

[root@localhost core]# /etc/init.d/core-daemon stop
[root@localhost core]# make uninstall ;  make clean
[root@localhost core]# make -j4
[root@localhost core]# make install
[root@localhost core]# systemctl enable core-daemon
Created symlink from /etc/systemd/system/multi-user.target.wants/core-daemon.service to /etc/systemd/system/core-daemon.service.

problem:
[root@n6 n6.conf]# docker info
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
resolve:
[root@localhost core]# iptables -F
[root@localhost core]# ip6tables -F

[root@localhost 桌面]# service core-daemon status
Redirecting to /bin/systemctl status  core-daemon.service
core-daemon.service - Common Open Research Emulator Service
   Loaded: loaded (/etc/systemd/system/core-daemon.service; disabled)
   Active: inactive (dead)

[root@localhost 桌面]# cat /etc/systemd/system/core-daemon.service
<span >
    [Unit]
    Description=Common Open Research Emulator Service
    After=network.target

    [Service]
    Type=forking
    PIDFile=/var/run/core-daemon.pid
    ExecStart=/usr/bin/python /usr/local/sbin/core-daemon -d

    [Install]
    WantedBy=multi-user.target

</span>

Here maybe what is installed with ''make install'':

<span style="font-size:18px;">
    /usr/local/bin/core-gui
    /usr/local/sbin/core-daemon
    /usr/local/sbin/[vcmd, vnoded, coresendmsg, core-cleanup.sh]
    /usr/local/lib/core/*
    /usr/local/share/core/*
    /usr/local/lib/python2.6/dist-packages/core/*
    /usr/local/lib/python2.6/dist-packages/[netns,vcmd].so
    /etc/core/*
    /etc/init.d/core

</span>

[root@localhost core]# /usr/share/openvswitch/scripts/ovs-ctl --system-id=random start
Starting ovsdb-server                                      [  OK  ]
Configuring Open vSwitch system IDs                        [  OK  ]
Starting ovs-vswitchd                                      [  OK  ]
Enabling remote OVSDB managers                             [  OK  ]


//Fedora 23 & CentOS 7

[root@localhost core]# systemctl daemon-reload
[root@localhost core]# systemctl start core-daemon.service
[root@localhost core]# core-gui



----------------
NOTE: first to run the following command if using docker.
# systemctl start docker.service
----------------

NOTE: /root/.core/configs/m-MPE-manet.imn


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
----------------
error:
----------------
  File "/usr/lib/python2.7/site-packages/docker/client.py", line 142, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
APIError: 400 Client Error: Bad Request ("client version 1.10 is too old. Minimum supported API version is 1.21, please upgrade your client to a newer version")
----------------

solution:
----------------
# gedit /opt/tools/network_simulators/core/core/daemon/core/services/dockersvc.py
----------------
if ''Client'' in globals():
    client = Client(version=''1.21'')
----------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

docker.sh

#!/bin/sh
# auto-generated by Docker (docker.py)
echo "nameserver 8.8.8.8" > /run/resolvconf/resolv.conf
service docker start
# you could add a command to start a image here eg:
# docker run -d --net host --name coreDock

[root@localhost 桌面]# ls /var/lib/docker/containers/
[root@localhost 桌面]# ls /run/shm
[root@localhost 桌面]# ls /run/resolvconf

---------------------------
[root@n6 n6.conf]# ls /run/shm
[root@n6 n6.conf]# cat /run/resolvconf/resolv.conf
nameserver 8.8.8.8
[root@n6 n6.conf]# ls /var/lib/docker/containers/
[root@n6 n6.conf]#


+++++++++++++++++++++++++++++
http://www.segurancaremota.com.br/2014/01/simular-roteamentos-no-linux-com-core.html

If you are looking for an environment light, practical and efficient to simulate networks, this environment is the core.

Best of all is that if all goes well, it ''s just save the configuration files (default quagga) and up to its routers.

With this system, you can train your skills with networks in an environment totally safe.

So we go to the "hands - on" and install the system. I made a "compiled" after reading the documentation in the official site -http://www.nrl.navy.mil/itd/ncs/products/core

The instructions will follow shortly after the video, but remember, I did this article in a Linux Kali (Debian), so if you''ll do in other distribution there may be some variation. In the Fedora also worked perfectly.

-------------------Downloads:

Core - http://downloads.pf.itd.nrl.navy.mil/core/source/core-4.6.tar.gz  

Quagga - http://downloads.sourceforge.net/project/quagga/quagga-0.99.20.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fquagga%2F&ts=1390603600&use_mirror=ufpr

Installing pre requirements # apt-get install bash bridge-utils ebtables iproute  libev-dev python tcl8.5 tk8.5 libtk-img autoconf  automake gcc libev-dev make python-dev  libreadline-dev pkg-config imagemagick help2man node gawk quagga  

-------------------Install CORE
# tar xzf core-4.6.tar.gz
# cd core-4.6
# ./bootstrap.sh
# ./configure
# make -j8
# make install

-------------------Installing Quagga
# yum group install ''Development Tools''        [on CentOS/RHEL 7/6]
# dnf group install ''Development Tools''        [on Fedora 22+ Versions]

/opt/tools/network_simulators/quagga/quagga-svnsnap.tgz
-rw-r--r--. 1 root root 2560375 1 月  14 14:27 ../quagga-svnsnap.tgz

# tar xzf quagga-0.99.21mr2.2.tar.gz
# cd quagga-0.99.21mr2.2


configure.ac:217: error: possibly undefined macro: AC_PROG_LIBTOOL
[root@localhost quagga]# dnf install libtool
[root@localhost quagga]# dnf install autoconf-archive

//automake: You are advised to start using ''subdir-objects'' option throughout your
[root@localhost quagga]# gedit configure.ac
dnl AM_INIT_AUTOMAKE(1.6)
AM_INIT_AUTOMAKE([subdir-objects])

[root@localhost quagga]# ./bootstrap.sh

[root@localhost quagga]# dnf install gcc-c++

[root@localhost quagga]# ./configure --enable-user=root --enable-group=root --with-cflags=-ggdb --sysconfdir=/usr/local/etc/quagga --enable-vtysh --localstatedir=/var/run/quagga

// 下面一行暂不需要
// copy basic.texi, ipv6.texi in quagga-0.99.24/doc   to   quagga-0.99.21mr2.2/doc

// makeinfo: command not found
[root@localhost quagga]# dnf install texinfo


# make -j4
# make install

-------------------Testing the environment
# core-gui


(OK) simply running CORE & docker on Fedora 23

(OK) simply running CORE & docker on Fedora 23

[root@localhost core]# ./bootstrap.sh
[root@localhost core]# ./configure --with-startup=systemd
[root@localhost core]# make
[root@localhost core]# make install 


[root@localhost core]#systemctl daemon-reload

[root@localhost core]# systemctl start core-daemon.service
[root@localhost core]# core-gui




NOTE: /root/.core/configs/m-MPE-manet.imn

----------------------
Under the Session Menu, the Options... dialog has an option to set a control network prefix.
This can be set to a network prefix such as 172.16.0.0/24. A bridge will be created on the host machine having the last address in the prefix range (e.g. 172.16.0.254), and each node will have an extra ctrl0 control interface configured with an address corresponding to its node number (e.g. 172.16.0.3 for n3.)
----------------------


[root@localhost 桌面]# . iptables_core.sh
[root@localhost 桌面]# cat iptables_core.sh

#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo 1 > /proc/sys/net/ipv4/tcp_syncookies

#网卡:上外、下内
#上外  192.168.0.100
#下内  172.16.0.254
#INET_IF="ppp0"
INET_IF="enp13s0"
LAN_IF="b.ctrl0net.6a"
#INET_IP="192.168.0.100"
INET_IP="10.108.162.164"
LAN_IP="172.16.0.254"
LAN_IP_RANGE="172.16.0.0/24"
#LAN_WWW="172.16.0.6"
IPT="/sbin/iptables"
#TC="/sbin/tc"
MODPROBE="/sbin/modprobe"

$MODPROBE ip_tables
$MODPROBE iptable_nat
$MODPROBE ip_nat_ftp
$MODPROBE ip_nat_irc
$MODPROBE ipt_mark
$MODPROBE ip_conntrack
$MODPROBE ip_conntrack_ftp
$MODPROBE ip_conntrack_irc
$MODPROBE ipt_MASQUERADE

for TABLE in filter nat mangle ; do
$IPT -t $TABLE -F
$IPT -t $TABLE -X
$IPT -t $TABLE -Z
done

$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -P FORWARD DROP 
$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT

# 拒绝INTERNET客户访问
#$IPT -A INPUT -i $INET_IF -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
#$IPT -A INPUT -i $INET_IF -p tcp -s 123.5.0.0/16 --dport 22 -j ACCEPT
$IPT -A INPUT -p tcp --dport 22 -j ACCEPT
$IPT -A INPUT -i $INET_IF -m state --state NEW,INVALID -j DROP

for DNS in $(grep ^n /etc/resolv.conf|awk ''{print $2}''); do
$IPT -A INPUT -p tcp -s $DNS --sport domain -j ACCEPT
$IPT -A INPUT -p udp -s $DNS --sport domain -j ACCEPT
done

# anti bad scaning
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags ALL FIN,URG,PSH -j DROP
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags ALL ALL -j DROP
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j DROP
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags ALL NONE -j DROP
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags SYN,RST SYN,RST -j DROP
$IPT -A INPUT -i $INET_IF -p tcp --tcp-flags SYN,FIN SYN,FIN -j DROP

#$IPT -t nat -A PREROUTING -d $INET_IP -p tcp --dport 8008 -j DNAT --to-destination $LAN_WWW:8008
#$IPT -t nat -A PREROUTING -d $INET_IP -p tcp --dport 22 -j DNAT --to-destination $LAN_WWW:22

if [ $INET_IF = "ppp0" ] ; then
$IPT -t nat -A POSTROUTING -o $INET_IF -s $LAN_IP_RANGE -j MASQUERADE
else
$IPT -t nat -A POSTROUTING -o $INET_IF -s $LAN_IP_RANGE -j SNAT --to-source $INET_IP
fi

#no limit
#$IPT -A FORWARD -s 192.168.1.216 -m mac --mac-source 00:15:17:F7:AB:84 -j ACCEPT
#$IPT -A FORWARD -d 192.168.1.216 -j ACCEPT

#$IPT -A FORWARD -p tcp -d ! $LAN_IP_RANGE -m multiport --dports ! 20,21,22,25,53,80,110,443,8080 -j DROP
#$IPT -A FORWARD -p udp -d ! $LAN_IP_RANGE -m multiport --dports ! 20,21,22,25,53,80,110,443,8080 -j DROP

#MAC、IP地址绑定
#$IPT -A FORWARD -s 192.168.1.11 -m mac --mac-source 44-87-FC-44-B9-6E -j ACCEPT

$IPT -A FORWARD -s 172.16.0.1 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.2 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.3 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.4 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.5 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.6 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.7 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.8 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.9 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.10 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.11 -j ACCEPT
$IPT -A FORWARD -s 172.16.0.12 -j ACCEPT

$IPT -A FORWARD -d 172.16.0.1 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.2 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.3 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.4 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.5 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.6 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.7 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.8 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.9 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.10 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.11 -j ACCEPT
$IPT -A FORWARD -d 172.16.0.12 -j ACCEPT

[root@n6 n6.conf]# route add default gw 172.16.0.254
[root@n6 n6.conf]# route -n 

[root@n6 n6.conf]# cat /etc/resolv.conf 

[root@n6 n6.conf]# ping www.bupt.edu.cn


---------------------------------------------------------------------------
至此,CORE虚拟节点访问互联网 成功


---------------------------------------------------------------------------
下面在CORE虚拟节点中 使用docker —— 前提,CORE虚拟节点访问互联网 成功
---------------------------------------------------------------------------


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OK OK
---------Install Docker on Fedora 23
dnf update -y
dnf -y install docker-io
systemctl start docker

systemctl start docker.service
systemctl restart docker.service
systemctl stop docker.service
systemctl status docker.service

systemctl status docker -l

^^^^^^宿主机测试
docker images
docker search centos
docker pull centos
docker images
docker tag 2933d50b9f77 docker.io/centos:core
docker run centos echo "hello world!"
^^^^^^至此,宿主机 OK

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OK OK in CORE node
[root@n6 n6.conf]#
docker daemon &
docker images
docker run centos echo "hello world!"
docker run --rm -it centos /bin/bash
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

---------------------------------------------------------------------------
至此,在CORE虚拟节点中 使用docker 成功
---------------------------------------------------------------------------




(OK)(OK) Fedora23-NS3-Android-x86-MANETs-Testing

(OK)(OK) Fedora23-NS3-Android-x86-MANETs-Testing



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
need java-1.7.0-openjdk, not java-1.8.0-openjdk
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

java -version

[root @localhost gem5-stable]# ls /usr/lib/jvm/
java                                           java-openjdk       jre-1.8.0-openjdk-1.8.0.91-6.b14.fc23.x86_64
java-1.8.0                                     jre                jre-openjdk
java-1.8.0-openjdk                             jre-1.8.0
java-1.8.0-openjdk-1.8.0.91-6.b14.fc23.x86_64  jre-1.8.0-openjdk
[root @localhost gem5-stable]#

============================================
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.
 
Your version is: openjdk version "1.8.0_91" OpenJDK Runtime Environment (build 1.8.0_91-b14) OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode).
The required version is: "1.7.x"
 
Please follow the machine setup instructions at
    https://source.android.com/source/initializing.html
************************************************************
build/core/main.mk:171: *** stop

#### make failed to build some targets (28 seconds) ####

[root @localhost android-6.0.1_r46]#
[root @localhost android-6.0.1_r46]# export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64
[root @localhost android-6.0.1_r46]# export PATH=$JAVA_HOME/bin:$PATH
[root@localhost android-6.0.1_r46]# java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (fedora-2.5.4.2.fc20-x86_64 u75-b13)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
[root@localhost android-6.0.1_r46]#

*********************************************************
install java-1.7.0-openjdk
*********************************************************
http://koji.fedoraproject.org/koji/buildinfo?buildID=605625

dnf search openjdk
dnf install java-atk-wrapper

[root@localhost Desktop]# ls java-1.7.0-openjdk-*
java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-accessibility-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-debuginfo-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-demo-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-devel-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-headless-1.7.0.75-2.5.4.2.fc20.x86_64.rpm
java-1.7.0-openjdk-src-1.7.0.75-2.5.4.2.fc20.x86_64.rpm

[root@localhost Desktop]# rpm -ivh --force --nodeps java-1.7.0-openjdk-*
[root@localhost Desktop]# java -version
[root@localhost Desktop]# ls /usr/lib/jvm/

export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64
export PATH=$JAVA_HOME/bin:$PATH
*********************************************************

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
download Android-x86-* from http://www.fosshub.com/Android-x86.html/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Android-x86 —— compile the source code
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://www.android-x86.org/getsourcecode

[root@localhost android-x86-6.0-rc1]# export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.75-2.5.4.2.fc20.x86_64
[root@localhost android-x86-6.0-rc1]# export PATH=$JAVA_HOME/bin:$PATH

[root@localhost android-x86-6.0-rc1]# . build/envsetup.sh
[root@localhost android-x86-6.0-rc1]# lunch android_x86-userdebug

[root@localhost android-x86-6.0-rc1]# m -j4 iso_img
Total translation table size: 6900
Total rockridge attributes bytes: 3312
Total directory bytes: 12288
Path table size(bytes): 88
Done with: The File(s)                             Block(s)    170078
Writing:   Ending Padblock                         Start Block 170122
Done with: Ending Padblock                         Block(s)    150
Max brk space used 22000
170272 extents written (332 MB)
/bin/bash: isohybrid: 未找到命令
isohybrid not found.
Install syslinux 4.0 or higher if you want to build a usb bootable iso.

out/target/product/x86/android_x86.iso is built successfully.

make: Leaving directory ''/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/android-x86/android-x86-6.0-rc1''
#### make completed successfully (03:19:54 (hh:mm:ss)) ####

------------------------------------------------------------
out/target/product/x86/android_x86.iso

[root@localhost android-x86-6.0-rc1]# ll -h out/target/product/x86/android_x86.iso
-rw-r--r--. 1 root root 333M 6月  13 18:42 out/target/product/x86/android_x86.iso
------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
install Android-x86 (android_x86.iso) in VirtualBox
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

refer to http://www.rickylford.com/install-android-5-1-on-virtualbox/

[root@localhost virtualbox-os]# pwd
/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/virtualbox-os

[root@localhost virtualbox-os]# ll -h
-rw-------. 1 root root 5.1G 6月  14 21:24 android-x86-6.0-rc1-1.vdi
[root@localhost virtualbox-os]#

Note: the name of Android-x86 Virtualhost created in VirtualBox is "android-x86-6.0-rc1-1", after, we will create new Android-x86 Virtualhosts by copying "android-x86-6.0-rc1-1".

[root@localhost virtualbox-os]# cp android-x86-6.0-rc1-1.vdi android-x86-6.0-rc1-2.vdi

[root@localhost virtualbox-os]# ll -h
-rw-------. 1 root root 5.1G 6月  14 21:24 android-x86-6.0-rc1-1.vdi
-rw-------. 1 root root 5.1G 6月  14 21:17 android-x86-6.0-rc1-2.vdi

[root@localhost virtualbox-os]# VBoxManage internalcommands sethduuid android-x86-6.0-rc1-2.vdi

--------------------------------------------------------------------------
the up command must be executed,
otherwise, Error when importing VDI file in VirtualBox
--------------------------------------------------------------------------

Cannot register the hard disk ''/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/virtualbox-os/Android-x86-6.0-rc1-1.vdi'' {dbfc8e7b-4969-4836-86d9-418e60328b83} because a hard disk ''/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/virtualbox-os/android-x86-6.0-rc1-2.vdi'' with UUID {dbfc8e7b-4969-4836-86d9-418e60328b83} already exists.

Solution:

[root@localhost virtualbox-os]# VBoxManage internalcommands sethduuid android-x86-6.0-rc1-1.vdi
UUID changed to: 865924c0-53b5-4aac-83b3-2402b33acdeb

[root@localhost virtualbox-os]# VBoxManage internalcommands dumphdinfo android-x86-6.0-rc1-1.vdi
--------------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running Android-x86 in VirtualBox
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-----------
in HOST
-----------
tunctl -t tap-left
ip link set up dev tap-left
brctl addbr br-android
brctl addif br-android tap-left
ip link set up dev br-android
ip addr add 10.1.1.1/24 dev br-android
ip route add 10.1.1.0/24 dev br-android
-----------
// VirtualBox > (android-x86-6.0-rc1-1) > Settings > Network > Adapter 1 > bridge, br-android.

-----------
in Android
-----------
-------------------------------------
// in HOST
[root@localhost busybox]# adb push busybox-x86_64 /data
[root@localhost busybox]# adb shell

// in Android
root@vbox86p:/ # cd data/
chmod 755 busybox-x86_64
-------------------------------------
// in Android

netcfg eth1 down
./busybox-x86_64 ifconfig eth1 down
./busybox-x86_64 ifconfig eth1 10.1.1.2 netmask 255.255.255.0 up

// ./busybox-x86_64 ip addr add 10.1.1.2/24 dev eth1
// ./busybox-x86_64 ip route add default via 10.1.1.1 dev eth1

./busybox-x86_64 route -n
./busybox-x86_64 ifconfig
./busybox-x86_64 ping 10.1.1.2
-----------

-------------------------------------
ifconfig br-android down
brctl delif br-android tap-left
brctl delif br-android eth1
brctl delbr br-android
ifconfig tap-left down
tunctl -d tap-left
//ip link delete veth_android44
//ip link delete X
-------------------------------------

http://cygnus.androidapksfree.com/hulk/com.UCMobile.intl_v10.10.0.796-238_Android-2.3.apk

http://www.apkmirror.com/wp-content/uploads/uploaded/5758ac63cb322/com.android.chrome_51.0.2704.81-270408111_minAPI21(x86)(nodpi)_apkmirror.com.apk
------------------------------------------------------------


--------------------------------------------------------------------------
netcat transfer file to android from fedora23
--------------------------------------------------------------------------
Server (fedora23)
[root@localhost Desktop]# pwd
/root/Desktop
[root@localhost Desktop]# ls cm-browser5-20-38.apk
cm-browser5-20-38.apk
[root@localhost Desktop]#
iptables -I INPUT -p tcp --dport 12123 -j ACCEPT
iptables -D INPUT -p tcp --dport 12123 -j ACCEPT
nc -l 12123 < chrome51.apk

Client (android)
nc 10.108.162.164 12123 > chrome51.apk

Client (fedora/linux)
nc -n 10.108.162.164 12123 > chrome51.apk

--------------------------------
nc -l 12123 > config.log
nc -n 172.17.0.1 12123  < config.log

--------------------------------------------------------------------------
Android 6.0 (Marshmallow) Install apk - INSTALL_FAILED_INVALID_URI
--------------------------------------------------------------------------

must be under the root directory:

cd /
pm install /sdcard/Download/chrome51.apk

Success
-------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running two Android-x86 in VirtualBox, they connect to "ethernet bridge"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

brctl addbr br-android
ip link set up dev br-android
ip addr add 10.1.1.1/24 dev br-android
ip route add 10.1.1.0/24 dev br-android

ifconfig br-android down
brctl delbr br-android

// VirtualBox > (android-x86-6.0-rc1-1) > Settings > Network > Adapter 1 > bridge, br-android.

// in android-x86-6.0-rc1-1
ifconfig eth0 down
ifconfig eth0 10.1.1.10 netmask 255.255.255.0 up

// VirtualBox > (android-x86-6.0-rc1-2) > Settings > Network > Adapter 1 > bridge, br-android.

// in android-x86-6.0-rc1-2
ifconfig eth0 down
ifconfig eth0 10.1.1.20 netmask 255.255.255.0 up

android-x86-6.0-rc1-1 can ping android-x86-6.0-rc1-2, and vice verse

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
compile quagga in CentOS in Docker
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[root@dc90dd730230 quagga]# uname -a
Linux dc90dd730230 4.4.8-300.fc23.x86_64 #1 SMP Wed Apr 20 16:59:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@dc90dd730230 quagga]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@dc90dd730230 quagga]#
------------------------------------------------

root@cd2cc1b26be3:~/quagga# ls ..
quagga  quagga-mtr  quagga-svnsnap.tgz
root@cd2cc1b26be3:~/quagga# pwd
/root/quagga

// root@cd2cc1b26be3:~/quagga# ./update-autotools
// root@cd2cc1b26be3:~/quagga# aclocal -I m4 --install

root@cd2cc1b26be3:~/quagga#

./bootstrap.sh
./configure --enable-user=root --enable-group=root --enable-vtysh --with-cflags=-ggdb

----------------------------------------------------------------------------------------
Quagga configuration
--------------------
quagga version          : 0.99.21mr2.2-dev
host operating system   : linux-gnu
source code location    : .
compiler                : gcc
compiler flags          : -ggdb
C++ compiler            : g++
C++ compiler flags      : -ggdb
make                    : make
includes                :  
linker flags            :  -lcrypt   -lrt   -ltermcap -lreadline -lm
state file directory    : /var/run
config file directory   : /usr/local/etc
example directory       : /usr/local/etc
user to run as        : root
group to run as        : root
group for vty sockets    :
config file mask        : 0600
log file mask           : 0600
generic netlink         : no
  (support for RFC 4938 link metrics)
----------------------------------------------------------------------------------------
make
make install

cd /usr/local/etc/
cp ospf6d.conf.sample ospf6d.conf
cp zebra.conf.sample zebra.conf

----------------------------------------------------------------------------------------
vi ospf6d.conf
----------------------------------------------------------------------------------------
interface eth0
 ipv6 ospf6 priority 1
 ipv6 ospf6 transmit-delay 1
 ipv6 ospf6 ifmtu 1500
 ipv6 ospf6 cost 1
 ipv6 ospf6 hello-interval 2
 ipv6 ospf6 dead-interval 6
 ipv6 ospf6 retransmit-interval 5
 ipv6 ospf6 network manet-designated-router
 ipv6 ospf6 ackinterval 1800
 ipv6 ospf6 backupwaitinterval 2000
 ipv6 ospf6 twohoprefresh 3
 ipv6 ospf6 hellorepeatcount 3
 ipv6 ospf6 adjacencyconnectivity biconnected
 ipv6 ospf6 lsafullness mdrfulllsa
 ipv6 ospf6 flood-delay 100
!
 
router ospf6
 instance-id 65
! router-id 10.1.0.1 (Note: Each node is not the same) (line 21)
 interface eth0 area 0.0.0.0
 protocol-traffic-class 184
 redistribute ospf
 redistribute connected
!
----------------------------------------------------------------------------------------

zebra -d
ospf6d -d
vtysh
> show ipv6 ospf6 route
> show ip route
> show ipv6 route
> exit

route add 123.123.123.123 reject
route -n
route del 123.123.123.123 reject

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, compile successfully quagga in CentOS in Docker
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




// install_quagga-0.99.21mr2.2_on_android-x86_64_in_Fedora23.txt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
cross compile quagga-0.99.21mr2.2 for android-x86_64 in Fedora23
quagga-0.99.21mr2.2 can be got from http://downloads.pf.itd.nrl.navy.mil/ospf-manet/
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------
www.nrl.navy.mil —— OSPF MANET Designated Routers (OSPF-MDR) Implementation
----------------------------------------------------------------------------------------
wget http://downloads.pf.itd.nrl.navy.mil/ospf-manet/nightly_snapshots/quagga-svnsnap.tgz
wget https://www.busybox.net/downloads/binaries/busybox-i686
----------------------------------------------------------------------------------------

[root@localhost quagga]# pwd
/opt/android-on-linux/quagga
[root@localhost quagga]# make clean

[root@localhost quagga]# ./bootstrap.sh

++++++++++++++++++ Issues
[root@localhost quagga]# gedit lib/zebra.h

//#include <sys/fcntl.h>
#include <fcntl.h>
++++++++++++++++++
xorp/libxorp/ipv4.hh:471:48: error: macro "static_assert" requires 2 arguments, but only 1 given
xorp/libxorp/ipv6.hh:425:52: error: macro "static_assert" requires 2 arguments, but only 1 given

[root@localhost quagga]# gedit ./xpimd/xorp/libxorp/ipv4.hh

    //static_assert(sizeof(IPv4) == sizeof(uint32_t));
    static_assert(sizeof(IPv4) == sizeof(uint32_t), "");

[root@localhost quagga]# gedit ./xpimd/xorp/libxorp/ipv6.hh

    //static_assert(sizeof(IPv6) == 4 * sizeof(uint32_t));
    static_assert(sizeof(IPv6) == 4 * sizeof(uint32_t), "");

[root@localhost quagga]# gedit ./xpimd/xorp/libxorp/ipvx.cc ./xpimd/xorp/libxorp/selector.cc ./xpimd/xorp/libproto/packet.hh
    //static_assert(*);

[root@localhost quagga]# gedit ./xpimd/xorp/libxorp/utility.h
    //#define UNUSED(var)    static_assert(sizeof(var) != 0)
    #define UNUSED(var)    static_assert(sizeof(var) != 0, "")

[root@localhost quagga]# gedit ./xpimd/xorp/libxorp/ipv6.cc
    //static_assert(sizeof(_addr) == sizeof(tmp_addr));
    static_assert(sizeof(_addr) == sizeof(tmp_addr), "");

--------------
/opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/__config:598:0: note: this is the location of the previous definition
 #define static_assert(__b, __m) \
--------------
++++++++++++++++++
xorp/fea/mfea_proto_comm.cc:1657:46: error: invalid conversion from ''void*'' to ''const uint8_t* {aka const unsigned char*}'' [-fpermissive]
   int_val = extract_host_int(CMSG_DATA(cmsgp));
-----

/opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/include/sys/socket.h:112:0: note: this is the location of the previous definition
 #define CMSG_DATA(cmsg) ((void*)((char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))

[root@localhost quagga]# gedit ./xpimd/xorp/fea/mfea_proto_comm.cc
    // add the following lines

    #define CMSG_DATA(cmsg) ((uint8_t*)((char*)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
#ifndef CMSG_LEN

#else // ! HAVE_RFC3542
    #undef HAVE_IPV6_MULTICAST_ROUTING

++++++++++++++++++++++
xorp/pim/pim_mrt_task.cc:185:14: error: ambiguous overload for ''operator!='' (operand types are ''std::__ndk1::list<PimMreTask*>::reverse_iterator {aka std::__ndk1::reverse_iterator<std::__ndk1::__list_iterator<PimMreTask*, void*> >}'' and ''std::__ndk1::list<PimMreTask*>::reverse_iterator {aka std::__ndk1::reverse_iterator<std::__ndk1::__list_iterator<PimMreTask*, void*> >}'')
     if (iter != pim_mre_task_list().rend()) {
              ^
xorp/pim/pim_mrt_task.cc:185:14: note: candidates are:
In file included from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/memory:604:0,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:628,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/string:439,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:15,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/ios:216,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/iostream:38,
                 from xorp/libxorp/xorp.h:35,
                 from xorp/pim/pim_mrt_task.cc:23:
/opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/iterator:593:1: note: bool std::__ndk1::operator!=(const std::__ndk1::reverse_iterator<_Iter1>&, const std::__ndk1::reverse_iterator<_Iter2>&) [with _Iter1 = std::__ndk1::__list_iterator<PimMreTask*, void*>; _Iter2 = std::__ndk1::__list_iterator<PimMreTask*, void*>]
 operator!=(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
 ^
In file included from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/algorithm:627:0,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/string:439,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/__locale:15,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/ios:216,
                 from /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/iostream:38,
                 from xorp/libxorp/xorp.h:35,
                 from xorp/pim/pim_mrt_task.cc:23:
/opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libcxx/include/utility:172:1: note: bool std::__ndk1::rel_ops::operator!=(const _Tp&, const _Tp&) [with _Tp = std::__ndk1::reverse_iterator<std::__ndk1::__list_iterator<PimMreTask*, void*> >]
 operator!=(const _Tp& __x, const _Tp& __y)
 ^
------------
[root@localhost quagga]# gedit ./xpimd/xorp/pim/pim_mrt_task.cc         (four places)

    //if (iter != pim_mre_task_list().rend()) {
    if (!(iter == pim_mre_task_list().rend())) {

++++++++++++++++++++++
[root@localhost quagga]# gedit ./xpimd/xorp/pim/pim_vif.cc

#include <netinet/ip6.h>
#include <netinet/in.h>

++++++++++++++++++++++
zebra_client.cc:186: error: undefined reference to ''zcalloc(int, unsigned int)''
zebra_client.cc:242: error: undefined reference to ''zfree(int, void*)''

[root@localhost quagga]# gedit xpimd/zebra_client.cc

#if 1 /* set to 1 to use system alloc directly */
#undef XMALLOC
#undef XCALLOC
#undef XREALLOC
#undef XFREE
#define XMALLOC(T,S) malloc((S))
#define XCALLOC(T,S) calloc(1, (S))
#define XREALLOC(T,P,S) realloc((P),(S))
#define XFREE(T,P) free((P))
#endif

++++++++++++++++++++++
zebra_router.cc:48: error: undefined reference to ''memory_init()''

[root@localhost quagga]# gedit xpimd/zebra_router.cc

    vty_init(master);
    //memory_init();

++++++++++++++++++++++
../lib/.libs/libzebra.so: error: undefined reference to ''crypt''

download from (libcrypt.so.1) https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/9a49bb368ac83fa339678d259ec2c6c668267db8/tree/initrd/lib/libcrypt.so.1?format=raw

cp libcrypt.so.1 /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so

++++++++++++++++++++++



-------------------------------------------------------
android-ndk-r12 + android-23 + x86-4.9 (static linked), failed
-------------------------------------------------------

[root@localhost quagga]#

./bootstrap.sh


make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r12"
export SYSROOT="$NDK_ROOT/platforms/android-23/arch-x86"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -I$NDK_ROOT/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include-fixed/ -I$NDK_ROOT/platforms/android-23/arch-x86/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"

export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -Wl,-dy -lcrypt -Wl,-dn -lstlport_static -lc++ -lm -lc"        ((can not work))

export CPATH="/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/i686-linux-android-cpp"
export CXX="$CPATH/i686-linux-android-g++"
export CC="$CPATH/i686-linux-android-gcc"
export LD="$CPATH/i686-linux-android-ld"
export AR="$CPATH/i686-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=i686-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

make -j4

-----------------------------------------------------
http://blog.csdn.net/ztguang/article/details/51030002

// -Wl,-dn -lLibraries -lWorkflowEngineD -lxerces-c -lsqlite -lstdc++ -lc -lstlport_static -Wl,-dy
// -Wl,-dy -lc -ldl -lstlport -lstdc++ -Wl,-dn
// -Wl,-v -Wl,-dy -lcrypt -Wl,-dn
-----------------------------------------------------

echo "ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}" > arm-linux.cache
echo "ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}" >> arm-linux.cache
echo "ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}" >> arm-linux.cache

./configure --enable-user=root --enable-group=root --host=i686-android-linux --enable-vtysh=no --cache-file=arm-linux.cache --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

make -j4
-----------------------------------------------------


----------------------------------------------------------------------
android-ndk-r10e + android-21 + x86-4.8 (dynamically linked), failed
----------------------------------------------------------------------

make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r10e"
export SYSROOT="$NDK_ROOT/platforms/android-21/arch-x86"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -I$NDK_ROOT/toolchains/x86-4.8/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.8/include-fixed/ -I$NDK_ROOT/platforms/android-21/arch-x86/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-21/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86 -lstlport_shared -lcrypt -lm -lc++ -lc"
export CPATH="/opt/android-on-linux/android-ndk-r10e/toolchains/x86-4.8/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/i686-linux-android-cpp"
export CXX="$CPATH/i686-linux-android-g++"
export CC="$CPATH/i686-linux-android-gcc"
export LD="$CPATH/i686-linux-android-ld"
export AR="$CPATH/i686-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=i686-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

make -j4

make install

----------------------------------------------------------------------
android-ndk-r19d + android-19 + x86-4.8 (dynamically linked), failed
----------------------------------------------------------------------

make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r9d"
export SYSROOT="$NDK_ROOT/platforms/android-19/arch-x86"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -I$NDK_ROOT/toolchains/x86-4.8/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.8/include-fixed/ -I$NDK_ROOT/platforms/android-19/arch-x86/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-19/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.8/libs/x86 -lstlport_shared -lcrypt -lm -lc++ -lc"
export CPATH="/opt/android-on-linux/android-ndk-r9d/toolchains/x86-4.8/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/i686-linux-android-cpp"
export CXX="$CPATH/i686-linux-android-g++"
export CC="$CPATH/i686-linux-android-gcc"
export LD="$CPATH/i686-linux-android-ld"
export AR="$CPATH/i686-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=i686-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

make -j4

make install



-------------------------------------------------------
Fedora 23, android-ndk-r12 + android-23 + x86-4.9 (dynamically linked), success
-------------------------------------------------------

++++++++++++++++++++++
../lib/.libs/libzebra.so: error: undefined reference to ''crypt''

download from (libcrypt.so.1) https://sourceforge.net/p/android-x86/bootable_newinstaller/ci/9a49bb368ac83fa339678d259ec2c6c668267db8/tree/initrd/lib/libcrypt.so.1?format=raw

cp libcrypt.so.1 /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d libcrypt.so

---------------------------------------------
can also find it in android-x86-6.0-rc1
---------------------------------------------
[root@localhost android-x86-6.0-rc1]# pwd
/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/android-x86/android-x86-6.0-rc1

[root@localhost android-x86-6.0-rc1]# find . -name libcrypt*
./bootable/newinstaller/initrd/lib/libcrypt.so.1

that is:
/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/android-x86/android-x86-6.0-rc1/bootable/newinstaller/initrd/lib/libcrypt.so.1
---------------------------------------------
++++++++++++++++++++++

[root@localhost quagga]# gedit configure

  /* LIBS="-lcrypt $LIBS" */
  LIBS=" $LIBS"

  /* LIBS="-lm $LIBS" */
  LIBS=" $LIBS"
  /* LIBM="-lm" */
  LIBM=""

++++++++++++++++++++++
the following, no use
++++++++++++++++++++++

download libcrypto.so from https://github.com/emileb/OpenSSL-for-Android-Prebuilt

[root@localhost lib]# pwd
/root/桌面/OpenSSL-for-Android-Prebuilt-master/openssl-1.0.2/x86/lib
[root@localhost lib]# cp libcrypto.so /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d libcrypto.so
++++++++++++++++++++++

[root@localhost quagga]# gedit lib/command.c lib/vty.c

safe_strerror(errno)  -->  "safe_strerror(errno)"

sed -i "s/__sF/exit/g" `grep "__sF" -rl ./tmp`

sed -i "s/safe_strerror(errno)/\"safe_strerror(errno)\"/g" `grep "safe_strerror(errno)" -rl ./`
sed -i "s/safe_strerror\ (errno)/\"safe_strerror(errno)\"/g" `grep "safe_strerror (errno)" -rl ./`
sed -i "s/\"safe_strerror(errno)\"/safe_strerror(errno)/g" `grep "\"safe_strerror(errno)\"" -rl ./`

sed -i "s/safe_strerror(save_errno)/\"safe_strerror(save_errno)\"/g" `grep "safe_strerror(save_errno)" -rl ./`
sed -i "s/safe_strerror\ (save_errno)/\"safe_strerror(save_errno)\"/g" `grep "safe_strerror (save_errno)" -rl ./`
sed -i "s/\"safe_strerror(save_errno)\"/safe_strerror(save_errno)/g" `grep "\"safe_strerror(save_errno)\"" -rl ./`

sed -i "s/safe_strerror(-errnum)/\"safe_strerror(-errnum)\"/g" `grep "safe_strerror(-errnum)" -rl ./`
sed -i "s/safe_strerror\ (-errnum)/\"safe_strerror(-errnum)\"/g" `grep "safe_strerror (-errnum)" -rl ./`
sed -i "s/\"safe_strerror(-errnum)\"/safe_strerror(-errnum)/g" `grep "\"safe_strerror(-errnum)\"" -rl ./`

sed -i "s/safe_strerror(en)/\"safe_strerror(en)\"/g" `grep "safe_strerror(en)" -rl ./`
sed -i "s/safe_strerror\ (en)/\"safe_strerror(en)\"/g" `grep "safe_strerror (en)" -rl ./`
sed -i "s/\"safe_strerror(en)\"/safe_strerror(en)/g" `grep "\"safe_strerror(en)\"" -rl ./`

sed -i "s/safe_strerror(sockerr)/\"safe_strerror(sockerr)\"/g" `grep "safe_strerror(sockerr)" -rl ./`
sed -i "s/safe_strerror\ (sockerr)/\"safe_strerror(sockerr)\"/g" `grep "safe_strerror (sockerr)" -rl ./`
sed -i "s/\"safe_strerror(sockerr)\"/safe_strerror(sockerr)/g" `grep "\"safe_strerror(sockerr)\"" -rl ./`


++++++++++++++++++++++

root@x86:/ # /system/xbin/quagga/zebra                                         
CANNOT LINK EXECUTABLE: cannot locate symbol "__errno_location" referenced by "/system/lib/libcrypt.so.1"...
1|root@x86:/ #

-----------------
CANNOT LINK EXECUTABLE: cannot locate symbol

If you get an error like CANNOT LINK EXECUTABLE: cannot locate symbol "signal" referenced by "gatord" on android, please ensure you are using the correct version of the Android ndk: ndk32 for 32-bit targets and ndk64 for 64-bit targets.

++++++++++++++++++++++
[root@localhost quagga]# gedit lib/crypt.c lib/crypt.h

http://blog.csdn.net/ztguang/article/details/51763624

++++++++++++++++++++++

[root@localhost quagga]# gedit lib/command.c

#include <crypt.h>

[root@localhost quagga]# gedit lib/Makefile.am                 // add crypt.c & crypt.h

libzebra_la_SOURCES = \
    network.c pid_output.c getopt.c getopt1.c daemon.c \
    checksum.c vector.c linklist.c vty.c built.c command.c crypt.c \

pkginclude_HEADERS = \
    buffer.h checksum.h command.h crypt.h filter.h getopt.h hash.h \

++++++++++++++++++++++
/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ../lib/.libs/libzebra.a(thread.o): multiple definition of ''thread_timer_remain_second''
/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: xpimd-zebra_thread.o: previous definition here
-------

[root@localhost quagga]# gedit ./xpimd/zebra_thread.hh ./xpimd/zebra_thread.cc

funcname_  -->  zt_
thread_  -->  zt_thread_

++++++++++++++++++++++

[root@localhost quagga]#

--------------------------
export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lcrypt -lm -lc++ -lc"

export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"

export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -lcrypt -Wl,-dn -lstlport_static -lm -lc++ -lc -Wl,-dy"

export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -static -Wl,-dn -lstlport_static -lm -lc++ -lc -Wl,-dy"

// -Wl,-soname -Wl,libzebra.so -o .libs/libzebra.so


--------------------------
can be successful (dynamically)
--------------------------
export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"

export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"
--------------------------

--------------------------
can be successful (static)
--------------------------
export LDFLAGS="--sysroot=$SYSROOT -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -static -lstlport_static -lm -lc++ -lc"
--------------------------

--------------------------
GCC: -static and -pie are incompatible for x86
--------------------------
Android 5+ —— error: only position independent executables (PIE) are supported.

CFLAGS += -fPIE
LDFLAGS += -fPIE -pie

such as:
export CFLAGS="-I/softdev/arm-libs/include -fPIE"
export CPPLAGS="$CPPFLAGS -fPIE"
export CXXLAGS="$CXXFLAGS -fPIE"
export LDFLAGS="-L/softdev/arm-libs/lib -static -fPIE -pie"
--------------------------


--------------------------
(OK)(OK)(OK) (x86)
--------------------------

-----------------------
export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -fuse-ld=bfd -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"
-----------------------

./bootstrap.sh


make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r12"
export SYSROOT="$NDK_ROOT/platforms/android-23/arch-x86"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -fPIE -I$NDK_ROOT/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include-fixed/ -I$NDK_ROOT/platforms/android-23/arch-x86/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -L$NDK_ROOT/platforms/android-23/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"
export CPATH="/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/i686-linux-android-cpp"
export CXX="$CPATH/i686-linux-android-g++"
export CC="$CPATH/i686-linux-android-gcc"
export LD="$CPATH/i686-linux-android-ld"
export AR="$CPATH/i686-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=i686-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

----------------------------------------
[root@localhost quagga]# gedit Makefile
//INCLUDES = -I/usr/inet6/include
INCLUDES =
----------------------------------------

make -j4

make install

ll -h out/sbin
ll -h out/lib

adb push out/sbin/ /system/xbin/quagga/
adb push out/lib/libzebra.so /lib/
adb push out/lib/libospf.so /lib/
adb push out/lib/libospfapiclient.so /lib/

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


----------------------------------------------------
(OK)(OK)(OK) (x86) —— android-x86-4.4-r5 (API 19)
----------------------------------------------------

-----------------------
export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -fuse-ld=bfd -L$NDK_ROOT/platforms/android-19/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"
-----------------------

./bootstrap.sh


make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r12"
export SYSROOT="$NDK_ROOT/platforms/android-19/arch-x86"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -fPIE -I$NDK_ROOT/toolchains/x86-4.9/prebuilt/linux-x86_64/lib/gcc/i686-linux-android/4.9.x/include-fixed/ -I$NDK_ROOT/platforms/android-19/arch-x86/usr/include -I$NDK_ROOT/platforms/android-21/arch-x86/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -L$NDK_ROOT/platforms/android-19/arch-x86/usr/lib/ -L$NDK_ROOT/platforms/android-21/arch-x86/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86 -lstlport_shared -lm -lc++ -lc"
export CPATH="/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/i686-linux-android-cpp"
export CXX="$CPATH/i686-linux-android-g++"
export CC="$CPATH/i686-linux-android-gcc"
export LD="$CPATH/i686-linux-android-ld"
export AR="$CPATH/i686-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=i686-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

----------------------------------------
[root@localhost quagga]# gedit Makefile
//INCLUDES = -I/usr/inet6/include
INCLUDES =
----------------------------------------

make -j4

make install

ll -h out/sbin
ll -h out/lib

adb push out/sbin/ /system/xbin/quagga/
adb push out/lib/libzebra.so /lib/
adb push out/lib/libospf.so /lib/
adb push out/lib/libospfapiclient.so /lib/

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

[root@localhost quagga]# ll -h out/sbin/
总用量 23M
-rwxr-xr-x. 1 root root 242K 6月  25 21:58 babeld
-rwxr-xr-x. 1 root root 1.6M 6月  25 21:58 bgpd
-rwxr-xr-x. 1 root root 1.1M 6月  25 21:58 ospf6d
-rwxr-xr-x. 1 root root  19K 6月  25 21:58 ospfclient
-rwxr-xr-x. 1 root root  20K 6月  25 21:58 ospfd
-rwxr-xr-x. 1 root root 271K 6月  25 21:58 ripd
-rwxr-xr-x. 1 root root 231K 6月  25 21:58 ripngd
-rwxr-xr-x. 1 root root  51K 6月  25 21:58 watchquagga
-rwxr-xr-x. 1 root root  19M 6月  25 21:58 xpimd
-rwxr-xr-x. 1 root root 390K 6月  25 21:58 zebra
[root@localhost quagga]#

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



----------------------------------------------------------------------
(OK)(OK)(OK) (x86_64) —— android-x86_64-6.0-rc1 (API 23)
----------------------------------------------------------------------

./bootstrap.sh


make clean

export NDK_ROOT="/opt/android-on-linux/android-ndk-r12"
export SYSROOT="$NDK_ROOT/platforms/android-23/arch-x86_64"
export CFLAGS="-g --pipe --sysroot=$SYSROOT -fPIE -I$NDK_ROOT/toolchains/x86_64-4.9/prebuilt/linux-x86_64/lib/gcc/x86_64-linux-android/4.9.x/include-fixed/ -I$NDK_ROOT/platforms/android-23/arch-x86_64/usr/include -I$NDK_ROOT/sources/cxx-stl/llvm-libc++/libcxx/include/ -I$NDK_ROOT/sources/android/support/include/"
export CPPFLAGS="$CFLAGS"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="--sysroot=$SYSROOT -fPIE -pie -L$NDK_ROOT/platforms/android-23/arch-x86_64/usr/lib/ -L$NDK_ROOT/sources/cxx-stl/stlport/libs/x86_64 -L$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/x86_64 -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64 -lstlport_shared -lm -lc++ -lc"
export CPATH="/opt/android-on-linux/android-ndk-r12/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin"
export CPP="$CPATH/x86_64-linux-android-cpp"
export CXX="$CPATH/x86_64-linux-android-g++"
export CC="$CPATH/x86_64-linux-android-gcc"
export LD="$CPATH/x86_64-linux-android-ld"
export AR="$CPATH/x86_64-linux-android-ar"

./configure --enable-user=root --enable-group=root --host=x86_64-android-linux --exec-prefix=/opt/android-on-linux/quagga/out --prefix=/opt/android-on-linux/quagga/out

make -j4

make install

ll -h out/sbin
ll -h out/lib
ll -h out/etc

----------------------------------------
root@x86:/ #
mount -o remount,rw /system
mount -o remount,rw /

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

adb shell mkdir -p /system/xbin/quagga/etc

adb push out/sbin/ /system/xbin/quagga/
adb push out/lib/libzebra.so /system/lib64/
adb push out/lib/libospf.so /system/lib64/
adb push out/lib/libospfapiclient.so /system/lib64/

adb push /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/stlport/libs/x86_64/libstlport_shared.so /system/lib64/
adb push /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.so /system/lib64/

[root@localhost quagga]#
cp out/etc/zebra.conf.sample out/etc/zebra.conf
cp out/etc/ospf6d.conf.sample out/etc/ospf6d.conf
gedit out/etc/ospf6d.conf
-----------------------------------------
interface eth0
 ipv6 ospf6 priority 1
 ipv6 ospf6 transmit-delay 1
 ipv6 ospf6 ifmtu 1500
 ipv6 ospf6 cost 1
 ipv6 ospf6 hello-interval 2
 ipv6 ospf6 dead-interval 6
 ipv6 ospf6 retransmit-interval 5
 ipv6 ospf6 network manet-designated-router
 ipv6 ospf6 ackinterval 1800
 ipv6 ospf6 backupwaitinterval 2000
 ipv6 ospf6 twohoprefresh 3
 ipv6 ospf6 hellorepeatcount 3
 ipv6 ospf6 adjacencyconnectivity biconnected
 ipv6 ospf6 lsafullness mdrfulllsa
 ipv6 ospf6 flood-delay 100
!
 
router ospf6
 instance-id 65
! router-id 10.1.0.1 (Note: Each node is not the same) (line 21)
 interface eth0 area 0.0.0.0
 protocol-traffic-class 184
 redistribute ospf
 redistribute connected
!
-----------------------------------------

adb shell mkdir -p /system/xbin/quagga/etc
adb shell mkdir -p /opt/android-on-linux/quagga/out/etc

adb push out/etc/zebra.conf /system/xbin/quagga/etc/
adb push out/etc/ospf6d.conf /system/xbin/quagga/etc/

adb shell cp /system/xbin/quagga/etc/zebra.conf /opt/android-on-linux/quagga/out/etc/
adb shell cp /system/xbin/quagga/etc/ospf6d.conf /opt/android-on-linux/quagga/out/etc/

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

root@x86_64:/ #
/system/xbin/quagga/zebra -d
/system/xbin/quagga/ospf6d -d
ps
--------------------
root      3135  1     8112   732            0 7fa5ddac075a S /system/xbin/quagga/zebra
root      3138  1     8704   2344           0 7f8ae094a75a S /system/xbin/quagga/ospf6d
root      3139  3014  5800   1844           0 7f3fd2f7a457 R ps
--------------------

//  /system/xbin/quagga/zebra -d -f /etc/zebra.conf
//  /system/xbin/quagga/ospf6d -d -f /etc/ospf6d.conf

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

adb connect 192.168.58.102:5555
adb devices
adb -s 192.168.58.102:5555 root
adb -s 192.168.58.102:5555 shell

adb disconnect 192.168.58.102:5555


----------------------------------------------------------------------
the following commands should be included in seem-tools-CLI-semi-auto.sh
----------------------------------------------------------------------
adb shell mkdir -p /opt/android-on-linux/quagga/out/etc
adb shell cp /system/xbin/quagga/etc/zebra.conf /opt/android-on-linux/quagga/out/etc/
adb shell cp /system/xbin/quagga/etc/ospf6d.conf /opt/android-on-linux/quagga/out/etc/
adb shell /system/xbin/quagga/zebra -d
adb shell /system/xbin/quagga/ospf6d -d
----------------------------------------------------------------------

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
So far, cross compile successfully quagga-0.99.21mr2.2 for android-x86_64 in Fedora23
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------


------------------------------------------------------------------------------------------------
(OK) install chrome & busybox in android-x86_64 —— uninstall chrome
------------------------------------------------------------------------------------------------
http://www.apkmirror.com/wp-content/uploads/uploaded/5758ac63cb322/com.android.chrome_51.0.2704.81-270408111_minAPI21(x86)(nodpi)_apkmirror.com.apk


[root@localhost apk]# pwd
/opt/android-on-linux/apk
[root@localhost apk]# ls
chrome.dev-53.0.2767.6.apk
[root@localhost apk]#

adb push chrome.dev-53.0.2767.6.apk /sdcard/Download/
adb push chrome_51.0.2704.81.apk /sdcard/Download/

adb push /opt/tools/busybox/busybox-x86_64 /system/xbin/

--------------------
//  must be under the root directory

root@x86_64:/ #
cd /
pm install /sdcard/Download/chrome.dev-53.0.2767.6.apk            (can not work)
pm install /sdcard/Download/chrome_51.0.2704.81.apk

root@x86_64:/ # pm list packages|grep chrome                                   
package:com.android.chrome
package:com.chrome.dev
root@x86_64:/ # pm uninstall com.chrome.dev

------------------------------------------------------------------------------------------------
(OK)(OK) Creating VMs from an existing VDI file in CLI (VBoxManage) in Fedora 23
------------------------------------------------------------------------------------------------
[root@localhost virtualbox-os]#
cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-1.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-2.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-3.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-4.vdi; cp android-x86_64-6.0-rc1-0.vdi android-x86_64-6.0-rc1-5.vdi;

VBoxManage internalcommands dumphdinfo android-x86_64-6.0-rc1-1.vdi

VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-1.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-2.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-3.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-4.vdi
VBoxManage internalcommands sethduuid android-x86_64-6.0-rc1-5.vdi



VBoxManage createvm --name android-x86_64-6.0-rc1-1 --ostype Linux_64 --register
VBoxManage modifyvm android-x86_64-6.0-rc1-1 --memory 1024 --vram 128 --usb off --audio pulse --audiocontroller sb16 --acpi on --rtcuseutc off --boot1 disk --boot2 dvd --nic1 bridged --bridgeadapter1 virbr0
VBoxManage storagectl android-x86_64-6.0-rc1-1 --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach android-x86_64-6.0-rc1-1 --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium android-x86_64-6.0-rc1-1.vdi

VBoxManage showvminfo android-x86_64-6.0-rc1-1

VBoxManage startvm android-x86_64-6.0-rc1-1

VBoxManage controlvm android-x86_64-6.0-rc1-1 poweroff
    //pause|resume|reset|poweroff|savestate|acpipowerbutton|acpisleepbutton|

// delete VM
VBoxManage unregistervm android-x86_64-6.0-rc1-1
rm /root/VirtualBox\ VMs/android-x86_64-6.0-rc1-1 -rf

//VBoxManage unregistervm android-x86_64-6.0-rc1-1 [--delete]
------------------------------------------------------------------------------------------------




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running Android-x86 in VirtualBox, install quagga-0.99.21mr2.2 in Android-x86
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-------------------------------------------------------
first, install quagga-mdr in android-x86-6.0-rc1-1
-------------------------------------------------------

------------------------------------------------
Android adb connect (android-x86-6.0-rc1-1)
------------------------------------------------
to set up the first android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-1) > Settings > Network > Adapter 1 > Host-only.
 ---> (android-x86-6.0-rc1-1) > (Alt+F1) > ifconfig (or netcfg) > 192.168.56.101
 ---> HOST: ping 192.168.56.101

[root@localhost ~]#
adb connect 192.168.56.101:5555
adb devices
adb -s 192.168.56.101:5555 root
adb -s 192.168.56.101:5555 shell

adb disconnect 192.168.56.101:5555

root@x86:/ #
mount -o remount,rw /system

[root@localhost quagga]# pwd
/opt/android-on-linux/quagga
[root@localhost quagga]#

adb shell mkdir /system/xbin/quagga
adb shell ls /system/xbin/quagga
adb shell ls /lib/
adb shell cp /lib/libc.so.org /lib/libc.so

adb push out/sbin/ /system/xbin/quagga/

adb push out/lib/libzebra.so /lib/
adb push out/lib/libospf.so /lib/
adb push out/lib/libospfapiclient.so /lib/

adb push /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so /lib/
adb push /opt/android-on-linux/android-ndk-r12/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so /lib/

-----------------------------------
adb pull /lib/libc.so /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so-android-x86-6
hte /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so-android-x86-6
    libc.so --> libc.so.6

adb push /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so-android-x86-6 /lib/libc.so.6

adb push /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so /lib/libc.so.6

---------------use the following
hte /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so
    libc.so --> libc.so.6

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d
/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-ld -d

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-nm /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so-android-x86-6 |grep __sF

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-nm /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so |grep __sF

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -a  out/sbin/zebra

---------------not use the following
hte /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so
hte /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so.1-android-x86-6
    libc.so.6 --> libc.so

-----------------------------------
[root@localhost android-x86-6.0-rc1]# find . -name libcrypt*
./bootable/newinstaller/initrd/lib/libcrypt.so.1

[root@localhost android-x86-6.0-rc1]# cp ./bootable/newinstaller/initrd/lib/libcrypt.so.1 /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so.1-android-x86-6

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

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-objdump -d /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so

-----------------------------------
adb push /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so.1-android-x86-6 /lib/libcrypt.so.1
adb push /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libcrypt.so /lib/libcrypt.so.1
adb push /opt/android-on-linux/android-ndk-r12/platforms/android-23/arch-x86/usr/lib/libc.so /lib/libc.so.6

+++++++++++++++++++++++++++++++++++
adb push /opt/android-on-linux/android-ndk-r10e/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so /lib/
adb push /opt/android-on-linux/android-ndk-r10e/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so /lib/
adb push /opt/android-on-linux/android-ndk-r10e/platforms/android-21/arch-x86/usr/lib/libcrypt.so /lib/libcrypt.so.1
adb push /opt/android-on-linux/android-ndk-r10e/platforms/android-21/arch-x86/usr/lib/libc.so /lib/libc.so.6

-----------------------------------
adb push /opt/android-on-linux/android-ndk-r9d/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so /lib/
adb push /opt/android-on-linux/android-ndk-r9d/sources/cxx-stl/llvm-libc++/libs/x86/libc++_shared.so /lib/
adb push /opt/android-on-linux/android-ndk-r9d/platforms/android-21/arch-x86/usr/lib/libcrypt.so /lib/libcrypt.so.1
adb push /opt/android-on-linux/android-ndk-r9d/platforms/android-21/arch-x86/usr/lib/libc.so /lib/libc.so.6

-----------------------------------
root@x86:/ # ls -l /lib/libc.so*                                             
-rw-r--r-- root     root      1144696 2016-06-14 12:23 libc.so
-rwxrwxrwx root     root       131656 2016-06-01 04:56 libc.so.6
root@x86:/ #
-----------------------------------


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

root@x86:/ #
chmod 755 /system/xbin/busybox-i686
busybox-i686 ls

-----------------------------------
/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d out/lib/libzebra.so |grep soname

 0x0000000e (SONAME)                     Library soname: [libzebra.so]

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d platforms/android-23/arch-x86/usr/lib/libcrypt.so |grep soname

 0x0000000e (SONAME)                     Library soname: [libcrypt.so.1]

/opt/android-on-linux/android-ndk-r12/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-readelf -d platforms/android-23/arch-x86/usr/lib/libc.so |grep soname

 0x0000000e (SONAME)                     Library soname: [libc.so]   ???? should be [libc.so.6]


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

-----------
in Android
-----------
-------------------------------------
// in HOST
[root@localhost busybox]# adb push busybox-x86_64 /data
[root@localhost busybox]# adb shell

// in Android
root@vbox86p:/ # cd data/
chmod 755 busybox-x86_64
-------------------------------------
// in Android

netcfg eth1 down
./busybox-x86_64 ifconfig eth1 down
./busybox-x86_64 ifconfig eth1 10.1.1.2 netmask 255.255.255.0 up

// ./busybox-x86_64 ip addr add 10.1.1.2/24 dev eth1
// ./busybox-x86_64 ip route add default via 10.1.1.1 dev eth1

./busybox-x86_64 route -n
./busybox-x86_64 ifconfig
./busybox-x86_64 ping 10.1.1.2
-----------

-------------------------------------
ifconfig br-android down
brctl delif br-android tap-left
brctl delif br-android eth1
brctl delbr br-android
ifconfig tap-left down
tunctl -d tap-left
//ip link delete veth_android44
//ip link delete X
-------------------------------------

http://cygnus.androidapksfree.com/hulk/com.UCMobile.intl_v10.10.0.796-238_Android-2.3.apk

http://www.apkmirror.com/wp-content/uploads/uploaded/5758ac63cb322/com.android.chrome_51.0.2704.81-270408111_minAPI21(x86)(nodpi)_apkmirror.com.apk
------------------------------------------------------------


--------------------------------------------------------------------------
netcat transfer file to android from fedora23
--------------------------------------------------------------------------
Server (fedora23)
[root@localhost Desktop]# pwd
/root/Desktop
[root@localhost Desktop]# ls cm-browser5-20-38.apk
cm-browser5-20-38.apk
[root@localhost Desktop]#
iptables -I INPUT -p tcp --dport 12123 -j ACCEPT
iptables -D INPUT -p tcp --dport 12123 -j ACCEPT
nc -l 12123 < chrome51.apk

Client (android)
nc 10.108.162.164 12123 > chrome51.apk

Client (fedora/linux)
nc -n 10.108.162.164 12123 > chrome51.apk

--------------------------------
nc -l 12123 > config.log
nc -n 172.17.0.1 12123  < config.log

--------------------------------------------------------------------------
Android 6.0 (Marshmallow) Install apk - INSTALL_FAILED_INVALID_URI
--------------------------------------------------------------------------

must be under the root directory:

cd /
pm install /sdcard/Download/chrome51.apk

Success
-------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






-------------------------------------------------------
So far, we have installed quagga-mdr in android-x86-6.0-rc1-1 successfully.
-------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
running five Android-x86 in VirtualBox, they connect to NS3(MANETs) via "ethernet bridge"
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


-----------
in HOST
-----------

brctl addbr br_a_1
tunctl -t tap_a_1
ifconfig tap_a_1 0.0.0.0 promisc up
brctl addif br_a_1 tap_a_1
ifconfig br_a_1 up

brctl addbr br_a_2
tunctl -t tap_a_2
ifconfig tap_a_2 0.0.0.0 promisc up
brctl addif br_a_2 tap_a_2
ifconfig br_a_2 up

brctl addbr br_a_3
tunctl -t tap_a_3
ifconfig tap_a_3 0.0.0.0 promisc up
brctl addif br_a_3 tap_a_3
ifconfig br_a_3 up

brctl addbr br_a_4
tunctl -t tap_a_4
ifconfig tap_a_4 0.0.0.0 promisc up
brctl addif br_a_4 tap_a_4
ifconfig br_a_4 up

brctl addbr br_a_5
tunctl -t tap_a_5
ifconfig tap_a_5 0.0.0.0 promisc up
brctl addif br_a_5 tap_a_5
ifconfig br_a_5 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 -

-----------

[root@localhost virtualbox-os]# pwd
/run/media/root/158a840e-63fa-4544-b0b8-dc0d40c79241/virtualbox-os

[root@localhost virtualbox-os]# ll -h
-rw-------. 1 root root 5.1G 6月  14 21:24 android-x86-6.0-rc1-1.vdi
-rw-------. 1 root root 5.1G 6月  14 21:17 android-x86-6.0-rc1-2.vdi
-rw-------. 1 root root 5.1G 6月  14 21:17 android-x86-6.0-rc1-3.vdi
-rw-------. 1 root root 5.1G 6月  14 21:17 android-x86-6.0-rc1-4.vdi
-rw-------. 1 root root 5.1G 6月  14 21:17 android-x86-6.0-rc1-5.vdi
[root@localhost virtualbox-os]#

-----------

to set up the first android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-1) > Settings > Network > Adapter 1 > bridge, br_a_1.

to set up the second android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-2) > Settings > Network > Adapter 1 > bridge, br_a_2.

to set up the second android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-3) > Settings > Network > Adapter 1 > bridge, br_a_3.

to set up the second android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-4) > Settings > Network > Adapter 1 > bridge, br_a_4.

to set up the second android-x86 VM in VirtualBox.
 ---> VirtualBox > (android-x86-6.0-rc1-5) > Settings > Network > Adapter 1 > bridge, br_a_5.

-----------

-----------
// in android-x86-6.0-rc1-1
-----------
ip addr add 172.17.0.1/16 dev eth0
ping 172.17.0.5

-----------
// in android-x86-6.0-rc1-5
-----------
ip addr add 172.17.0.5/16 dev eth0
ping 172.17.0.1

//ifconfig eth0 down
//ifconfig eth0 192.168.26.20 netmask 255.255.255.0 up

------------------------------------------------------------------------------------------
android-x86-6.0-rc1-1 can not ping android-x86-6.0-rc1-5
------------------------------------------------------------------------------------------


-----------------------
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-android-x86.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));

  tapBridge.SetAttribute ("DeviceName", StringValue ("tap_a_3"));
  tapBridge.Install (nodes.Get (2), devices.Get (2));

  tapBridge.SetAttribute ("DeviceName", StringValue ("tap_a_4"));
  tapBridge.Install (nodes.Get (3), devices.Get (3));

  tapBridge.SetAttribute ("DeviceName", StringValue ("tap_a_5"));
  tapBridge.Install (nodes.Get (4), devices.Get (4));

//----------------

[root@localhost ns-3.25]# ./waf --run manet-android-x86 --vis


------------------------------------------------------------------------------------------
android-x86-6.0-rc1-1 can ping android-x86-6.0-rc1-5 successfully, and vice verse
------------------------------------------------------------------------------------------


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

ifconfig br_a_3 down
brctl delif br_a_3 tap_a_3
brctl delbr br_a_3
ifconfig tap_a_3 down
tunctl -d tap_a_3

ifconfig br_a_4 down
brctl delif br_a_4 tap_a_4
brctl delbr br_a_4
ifconfig tap_a_4 down
tunctl -d tap_a_4

ifconfig br_a_5 down
brctl delif br_a_5 tap_a_5
brctl delbr br_a_5
ifconfig tap_a_5 down
tunctl -d tap_a_5

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
So far, all is OK
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


今天关于(OK) running imunes in Fedora 23的讲解已经结束,谢谢您的阅读,如果想了解更多关于(OK) install WINE in Fedora 23 or Later、(OK) running CORE—Common Open Research Emulator—docker、(OK) simply running CORE & docker on Fedora 23、(OK)(OK) Fedora23-NS3-Android-x86-MANETs-Testing的相关知识,请在本站搜索。

本文标签: