OpenWrt 旁路由及OpenClash设置

2024-07-24 2,604 0

主路由IP: 192.168.77.1/24
OpenWrt则使用 192.168.77.2/24

使用的旁路由的原因:
若OpenWrt有部署Wireguard服务器,新增帐号生效,会网络中断一会。
若OpenWrt同时使用Wireguard和OpenClash会冲突,导致Wireguard无法握手连通。

旁路由配置

网络-接口-编辑
image-20240724165045314

这里不用专门弄多一个wan口, 使用br-lan即可

IPv4地址使用跟主路由同网段,网关为主路由IP

image-20240724172750735

设置DNS服务器,禁用IPV6

image-20240724172840014

关闭DHCP

image-20240724172913424

禁用DHCP IPV6

image-20240724172951756

此时将客户端的网关指向旁路由

[root@rancher ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens192
DEVICE=ens192
ONBOOT=yes
IPADDR=192.168.77.15
NETMASK=255.255.255.0
GATEWAY=192.168.77.2

systemctl restart network
[root@rancher sunday]# ip route list
default via 192.168.77.2 dev ens192 proto static metric 100 
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 
192.168.77.0/24 dev ens192 proto kernel scope link src 192.168.77.15 metric 100 

网络正常

[root@rancher ~]# ping www.baidu.com
PING www.a.shifen.com (157.148.69.80) 56(84) bytes of data.
64 bytes from 157.148.69.80 (157.148.69.80): icmp_seq=1 ttl=49 time=7.71 ms

OpenClash

image.png

image-20240724214541177

image-20240724174008627

插件下载内核版本
image.png

启动OpenClash
image.png

Docker 拉取正常

[root@rancher ~]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
efc2b5ad9eec: Pull complete 
8fe9a55eb80f: Pull complete 
045037a63be8: Pull complete 
7111b42b4bfa: Pull complete 
3dfc528a4df9: Pull complete 
9e891cdb453b: Pull complete 
0f11e17345c5: Pull complete 
Digest: sha256:6af79ae5de407283dcea8b00d5c37ace95441fd58a8b1d2aa1ed93f5511bb18c
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest

clash日志
image-20240724174707197

相关文章

openwrt frp配置
ESXI 8.0 OpenWrt X86 虚拟机部署
openwrt usb热插拔 u盘或移动硬盘热插自动挂载
openwrt 移动硬盘开机挂载失效解决

发布评论