miao1007 / Openwrt-NetKeeper

[C/C++] Run Netkeeper on OpenWrt Device
1.03k stars 288 forks source link

nk4conf运行出错 #216

Closed greedyhao closed 6 years ago

greedyhao commented 6 years ago

系统信息

Pandorabox Base on OpenWrt BARRIER BREAKER (14.09, r1018)

运行信息

[root@PandoraBox:/root]#sh /tmp/netkeeper4-use-pppoer-server/nk4conf.sh 
uci: Entry not found
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing IPv4 raw table
 * Flushing IPv6 filter table
 * Flushing IPv6 mangle table
 * Flushing IPv6 raw table
 * Flushing conntrack table ...
 * Populating IPv4 filter table
   * Zone 'lan'
   * Zone 'wan'
   * Rule 'Allow-DHCP-Renew'
   * Rule 'Allow-Ping'
   * Forward 'lan' -> 'wan'
 * Populating IPv4 nat table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv4 mangle table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv4 raw table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv6 filter table
   * Zone 'lan'
   * Zone 'wan'
   * Rule 'Allow-DHCPv6'
   * Rule 'Allow-ICMPv6-Input'
   * Rule 'Allow-ICMPv6-Forward'
   * Forward 'lan' -> 'wan'
 * Populating IPv6 mangle table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv6 raw table
   * Zone 'lan'
   * Zone 'wan'
 * Set tcp_ecn to off
 * Set tcp_syncookies to on
 * Set tcp_window_scaling to on
 * Running script '/etc/firewall.user'
 * Running script '/usr/share/miniupnpd/firewall.include'
 * Running script '/usr/share/redsocks2/firewall.include'
redsocks2 is not enabled.Exit now.
   ! Failed with exit code 1
 * Running script '/usr/share/shadowsocks/firewall.include'
cp: can't stat '/root/nk4': No such file or directory
chmod: /etc/init.d/nk4: No such file or directory
/tmp/netkeeper4-use-pppoer-server/nk4conf.sh: line 46: /etc/init.d/nk4: not found
[root@PandoraBox:/root]#/tmp/netkeeper4-use-pppoer-server/nk4conf.sh: line 48: /etc/init.d/nk4: not found

[root@PandoraBox:/root]#
huipengly commented 6 years ago

cp: can't stat '/root/nk4': No such file or directory

没有拷贝nk4文件到root目录

greedyhao commented 6 years ago

@huipengly 现在拷贝了nk4到root 但是还是报错

[root@PandoraBox:/root]#sh nk4conf.sh 
uci: Entry not found
 ...
 * Running script '/etc/firewall.user'
 * Running script '/usr/share/miniupnpd/firewall.include'
 * Running script '/usr/share/redsocks2/firewall.include'
redsocks2 is not enabled.Exit now.
   ! Failed with exit code 1
 * Running script '/usr/share/shadowsocks/firewall.include'
[root@PandoraBox:/root]#ls
nk4         nk4.sh      nk4conf.sh
huipengly commented 6 years ago
 * Running script '/usr/share/redsocks2/firewall.include'
redsocks2 is not enabled.Exit now.

问题好像出在这里,但是这个redsocks2没用过,不知道怎么解决

greedyhao commented 6 years ago

@huipengly

[root@PandoraBox:/root]#sh nk4conf.sh 
uci: Entry not found
 ...
 * Running script '/etc/firewall.user'
 * Running script '/usr/share/miniupnpd/firewall.include'
 * Running script '/usr/share/redsocks2/firewall.include'
 * Running script '/usr/share/shadowsocks/firewall.include'
Interface netkeeper not found

我随便在网上找了个redsocks的配置后,现在报错信息换了

[root@PandoraBox:/root]#cat /etc/config/network
...
config interface 'netkeeper'
    option ifname 'eth0.2'
    option macaddr 'aabbccddeeff'
    option proto 'pppoe'
    option metric '0'
    option auto '0'
    option pppd_options 'plugin chongqing_sxplugin.so'
    option username '************'
    option password '*****'

但是可以看得见,这个interface是存在的

huipengly commented 6 years ago

要么试试卸了redsocks2.

opkg remove redsocks2

好久不用openwrt了,命令记不清了,你搜搜。在网页端也能卸载

greedyhao commented 6 years ago

@huipengly 抱歉,回晚了。 我感觉可能不是redsocks2的问题,这个包我重装过了 我想找到报这句错误信息的脚本

Interface netkeeper not found

可惜没找到

huipengly commented 6 years ago

nk4conf.sh

uci set network.netkeeper=interface
uci set network.netkeeper.ifname=$(uci show network.wan.ifname | awk -F "'" '{print $2}')
uci set network.netkeeper.proto=pppoe
uci set network.netkeeper.username=username
uci set network.netkeeper.password=password
uci set network.netkeeper.metric='0'
uci set network.netkeeper.auto='0'
uci commit network

这几句会生成一个叫netkeeper的接口,并配置账号密码等。

greedyhao commented 6 years ago

@huipengly 是的,接口已经生成,可是不知道为什么报错说找不到这个接口

greedyhao commented 6 years ago

@huipengly 今天再试的时候突然不报错了,非常感谢