config globals 'globals'
config interface 'lan'
option type 'bridge'
option ifname 'eth1 eth2 eth3'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.8.108'
option gateway '192.168.8.1'
option dns '192.168.8.1'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'
config interface 'wan6'
option ifname 'eth0'
option proto 'dhcpv6'
option reqaddress 'try'
option reqprefix 'auto'
config interface 'lan6'
option proto 'dhcpv6'
option ifname '@lan'
option reqaddress 'try'
option reqprefix 'auto'
option clientid 'cafe:0108'
config interface 'wgs0'
option proto 'wireguard'
option private_key 'PRIVKEY'
option listen_port '1380'
list addresses '10.7.0.1/16'
list addresses 'fda7::1/64'
config wireguard_wgs0 '1005'
option public_key 'PUBKEY'
list allowed_ips '10.7.10.5/32'
list allowed_ips 'fda7::1005/128'
option route_allowed_ips '1'
#!/bin/bash
IPT="/usr/sbin/iptables"
IPT6="/usr/sbin/ip6tables"
IN_FACE="br-lan" # NIC connected to the internet
IN_FACE6="br-lan" # NIC connected to the internet
WG_FACE="wgs0" # WG NIC
SUB_NET="10.7.0.0/16" # WG IPv4 sub/net aka CIDR
WG_PORT="1380" # WG udp port
SUB_NET_6="fda7::/64" # WG IPv6 sub/net
## IPv4 ##
$IPT -t nat -I POSTROUTING 1 -s $SUB_NET -o $IN_FACE -j MASQUERADE
$IPT -I INPUT 1 -i $WG_FACE -j ACCEPT
$IPT -I FORWARD 1 -i $IN_FACE -o $WG_FACE -j ACCEPT
$IPT -I FORWARD 1 -i $WG_FACE -o $IN_FACE -j ACCEPT
$IPT -I INPUT 1 -i $IN_FACE -p udp --dport $WG_PORT -j ACCEPT
## IPv6 ##
$IPT6 -t nat -I POSTROUTING 1 -s $SUB_NET_6 -o $IN_FACE6 -j MASQUERADE
$IPT6 -I INPUT 1 -i $WG_FACE -j ACCEPT
$IPT6 -I FORWARD 1 -i $IN_FACE6 -o $WG_FACE -j ACCEPT
$IPT6 -I FORWARD 1 -i $WG_FACE -o $IN_FACE6 -j ACCEPT
$IPT6 -I INPUT 1 -i $IN_FACE6 -p udp --dport $WG_PORT -j ACCEPT
请问是什么原因?哪里可能存在问题?
谢谢!
1
yaott2020 2022-05-02 22:02:36 +08:00 via Android
openwrt 有 luci 界面可以配置 wg ,只有防火墙配置需要额外加脚本
|
2
DopaminePlz OP @yaott2020 WG 接口旳配置应该没有问题旳,主要问题是客户端不能访问 IPv6 网络。
|
3
yaott2020 2022-05-05 17:44:54 +08:00 via Android
客户端路由看看有没有 ::/0 没有就加上
|
4
DopaminePlz OP @yaott2020 加上了,还是没有获取 IPv6 旳 GUA 地址,只有 ULA 地址,可行 PING 通 fda7::1 。
|