1
Chinese - 中文 / Re: opnsense两侧主机不通的问题
« on: August 11, 2022, 08:47:53 am »
LAN 到 WAN是通过NAT实现的。
如果要互通,关闭NAT,再添加路由即可
如果要互通,关闭NAT,再添加路由即可
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
不明觉厉,看群主写的,代码一溜一溜的,看的脑瓜大。这也能插小广告我也是服了
如是我的话,想要科学上网那就直接找一些好用的软件来用,不懂的就直接去问软件的客服了。
external-controller: 0.0.0.0:9090
external-ui: ./ui
如果在配置中引用了外部的节点列表和分流规则,请先在本地按这个配置先运行一次clash,把节点列表和分流规则先下载下来准备好,否则在opnsense中直接运行clash,会因为某些墙外的连接无法下载而启动失败。第三个是web控制界面clash dashboard (https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip),下载、解压、修改文件夹名为“ui”。以上准备完后,有clash,config.yaml两个文件和 Proxy、RuleSet、ui三个文件夹。vi /usr/local/etc/rc.d/clash #建立服务配置文件
chmod +x /usr/local/etc/rc.d/clash #给刚才建立服务配置文件添加执行权限
#!/bin/sh
# $FreeBSD$
# PROVIDE: clash
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable clash:
# clash_enable (bool): Set to "NO" by default.
# Set to "YES" to enable clash.
# clash_config (path): Clash config dir.
# Defaults to "/usr/local/etc/clash"
. /etc/rc.subr
name="clash"
rcvar=clash_enable
load_rc_config $name
: ${clash_enable:="NO"}
: ${clash_config="/usr/local/etc/clash"}
command="/usr/local/bin/clash"
#pidfile="/var/run/clash.pid"
required_files="${clash_config}"
command_args="-d $clash_config"
run_rc_command "$1"
vi /usr/local/opnsense/service/conf/actions.d/actions_clash.conf
service configd restart #使刚才的文件生效
actions_clash.conf文件内容如下[start]
command:/usr/local/etc/rc.d/clash onestart
type:script
message:starting clash
[stop]
command:/usr/local/etc/rc.d/clash stop
type:script
message:stoping clash
[status]
command:/usr/local/etc/rc.d/clash statusexit 0
type:script_output
message:get clash status
[restart]
command:/usr/local/etc/rc.d/clash onerestart
type:script
message:restarting clash