路由器:PHICOMM K2P
固件:openwrt-chaos_calmer-k2p-v1.5-16M-fast-path.bin
手動交叉編譯完ndppd v0.2.5,用WinSCP把編譯好的ndppd放入/etc/config路徑下,並修改執行權限運行。
執行過程如下:
root@Enn1ys:~# cd /etc/config
root@Enn1ys:/etc/config# chmod 777 ndppd_v025
root@Enn1ys:/etc/config# ./ndppd_v025
./ndppd_v025: can’t load library ‘libstdc++.so.6’
原因
缺少libstdc++標準庫
解決方案
在路由中安裝libstdc++庫。
OpenWRT官網下載站找到與你路由器對應架構的包目錄,目錄下可以找到libstdcpp的ipk包,用opkg install命令安裝即可。安裝好後再執行ndppd,可以正常啓動。
執行過程如下:
root@Enn1ys:/etc/config# opkg install http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7621/packages/base/libstdcpp_4.8-linaro-1_ramips_1004kc.ipk
Downloading http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7621/packages/base/libstdcpp_4.8-linaro-1_ramips_1004kc.ipk.
Installing libstdcpp (4.8-linaro-1) to root…
Configuring libstdcpp.
root@Enn1ys:/etc/config# ./ndppd_v025
(notice) ndppd (NDP Proxy Daemon) version 0.2.4
(notice) Using configuration file ‘/etc/ndppd.conf’
^C(error) Shutting down…
(error) Failed to poll interfaces: Interrupted system call
(notice) Bye
還有一種方法是可以嘗試在編譯時ndppd時選擇靜態編譯。(未測試)
無關緊要的結尾:
Github上拖下來的源碼README上面的版本號是v0.2.5, 不知道爲啥執行的時候還是顯示0.2.4。