커널이 Wireguard를 지원하고 해당 기능을 활성화했다고 가정합니다. Table 옵션을 사용하면 wg-quick이 기본 라우트를 덮어쓰는 것을 막을 수 있습니다.
예를 들어 wg0.conf:
ini
[Interface]
PrivateKey = ...
Address = 172.16.0.1/32
MTU = ...
Table = off
PostUp = ip rule add from 172.16.0.1/32 table 6666
[Peer]
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
PublicKey = ...
Endpoint = ...이제 Clash에는 지정한 아웃바운드 인터페이스가 포함된 DIRECT 정책 그룹 하나만 있으면 됩니다:
yaml
proxy-groups:
- name: Wireguard
type: select
interface-name: wg0
proxies:
- DIRECT
rules:
- DOMAIN,google.com,Wireguard이는 보통 Clash가 직접 구현한 사용자 공간 Wireguard 클라이언트보다 성능이 좋습니다. Wireguard는 커널에서 지원됩니다.
