OpenWRT内网穿透——花生壳

很多使用 OpenWRT 的朋友都有内网穿透的需求, 其实使用 ddns + wireguard 也是比较方便的, 只是在技术上有一定的门槛. 不过有些荷包比较满的不喜欢折腾的, 直接使用花生壳, 其实费用也并不贵, 免费的貌似也可以用. 网上也有很多的相关教程, 不过这些都是建立在内核支持的情况下, 大部分默认编译的内核都不支持花生壳应用的.

根据网上的教程直接 下载 OpenWRT的程序

选择对应的版本, 使用opkg install.

1opkg install phtunnel.ipk phtunnel-luci-app.ipk

顺利的话, 说明你的内核是支持这些依赖的模块. 如果出现下面的错误, 需要重新编译内核, 打开这些参数

 1* pkg_ hash check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nfnetlink
 2* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nf-reject
 3* pkg_ hash check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nf-reject6
 4* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131fc64) for kmod-nf-conntrack
 5* pkg hash check unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131fc64) for kmod-nf-conntrack6
 6* pkg_hash check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131 fc64) for kmod-nf-nat
 7* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131fc64) for kmod-nf-log
 8* pkg_hash_check _unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nf-log6
 9* pkg_hash _check unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131f64) for kmod-crypto-hash
10* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131 fc64) for kmod-crypto-crc32c
11* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131fc64) for kmod-lib-crc32c
12* pkg_hash_ check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nft -core
13* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131 fc64) for kmod-nft-fib
14* pkg hash check unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-nf-flow
15* pkg_hash check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131 fc64) for kmod-nft-nat
16* pkg hash check unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131fc64) for kmod-nft-offload
17* pkg hash check unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131fc64) for kmod-nf-ipt
18* pkg_ hash_ check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131 fc64) for kmod-ipt-core
19* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6536131 fc64) for kmod-ipt-conntrack
20* pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.134-1-47964456485559d992fe6f536131fc64) for kmod-ipt-nat

此文就详细的解释一下, 如何开启这些内核模块.

make menuconfig

1Network ---->
2    Web Servers/Proxies ---->
3    <*> cgi-io

Kernel modules --> Netfilter Extensions -->

 1-*- kmod-ipt-conntrack ........ Basic connection tracking modules
 2-*- kmod-ipt-core      ........ Iptables core
 3-*- kmod-ipt-nat       ........ Basic NAT target
 4
 5-*- kmod-nf-conntrack
 6-*- kmod-nf-conntrack6
 7-*- kmod-nf-ipt
 8-*- kmod-nfnetlink
 9-*- kmod-nf-flow
10-*- kmod-nf-nat
11-*- kmod-nf-log
12-*- kmod-nf-log6
13-*- kmod-nf-reject
14-*- kmod-nf-reject6
15
16<*> kmod-nft-core
17<*> kmod-nft-fib
18<*> kmod-nft-nat
19<*> kmod-nft-offload

Kernel modules --> Cryptographic API modules -->

1-*- kmod-crypto-crc32c

Kernel modules --> Libraries -->

1-*- kmod-lib-crc32c

后续参考 《软路由(OpenWRT)进阶编译,深度裁剪》 选择你需要的模块

make -j4 V=s 编译打包