eBPF学习项目:利用ebpf实现国内IP绕过openclash实现快速转发
- 解压openwrt编译好的llvm工具链:
llvm-bpf-21.1.6.Linux-x86_64 - 将代码
tc_direct_path.c和编译脚本build.sh拷贝到工具链目录中llvm-bpf-21.1.6.Linux-x86_64/llvm-bpf/ - 执行编译脚本
build.sh - 拷贝生成的
tc_direct_path.o到openwrt设备上 - 拷贝其他脚本
cleanup_env.sh、deploy_direct_path.sh以及load_china_ip.sh等到openwrt设备上与tc_direct_path.o同目录 - 部署执行
deploy_direct_path.sh,然后载入国内域名执行load_china_ip.sh
- 如需恢复环境执行
cleanup_env.sh
- 查看调试信息可在
openwrt设备上执行:cat /sys/kernel/debug/tracing/trace_pipe
- 查看缓存利用率,执行
check_cache.sh