Temat: wireguard klient
Cześć,
juz x godzin probuje to skonfigurowac. postawilem serwer wireguard u siebie w domu na raspberry. skonfigurowalem klientow, jeden to telefon drugi to router z gargoyle w drugiej lokalizacji. telefon dziala na configu od telefonu. telefon rowniez dziala na configu od drugiej lokalizacji. niestety przy wklejaniu configu do routera w drugiej lokalizacji ten pokazuje ze jest online ale niestety ciagle wysyla handshake;i:
[ +5.757296] wireguard: wg0: Receiving handshake initiation from peer 89 (89.23xxx:51820)
[ +0.000027] wireguard: wg0: Sending handshake response to peer 89 (89.230xxx:51820)
[ +0.000594] wireguard: wg0: Keypair 1568 destroyed for peer 89
[ +0.000008] wireguard: wg0: Keypair 1569 created for peer 89
[ +5.759732] wireguard: wg0: Receiving handshake initiation from peer 89 (89.2xxx235:51820)
[ +0.000027] wireguard: wg0: Sending handshake response to peer 89 (89.23xxx35:51820)
[ +0.000596] wireguard: wg0: Keypair 1569 destroyed for peer 89
[ +0.000008] wireguard: wg0: Keypair 1570 created for peer 89
[ +5.759343] wireguard: wg0: Receiving handshake initiation from peer 89 (89.2xxx235:51820)
[ +0.000028] wireguard: wg0: Sending handshake response to peer 89 (89.2xxx:51820)
[ +0.000607] wireguard: wg0: Keypair 1570 destroyed for peer 89komenda wg z routera gargoyle:
root@Gargoyle:/etc/config# wg
interface: wg0
public key: ciach
private key: (hidden)
listening port: 51820
peer: ciach
endpoint: 89.231.xxxx:41194
allowed ips: 192.168.1.0/24
transfer: 0 B received, 5.78 KiB sentkomenda wg z serwera wireguard:
root@rpi:/etc/wireguard# wg
interface: wg0
public key: xxxx
private key: (hidden)
listening port: 41194
peer: xxxx (to jest router gargoyle)
preshared key: (hidden)
endpoint: 89.2xxxxxx:51820
allowed ips: 192.168.6.4/32
latest handshake: 22 minutes, 39 seconds ago
transfer: 24.14 KiB received, 64.27 KiB sent
peer: xxx (to jest telefon)
preshared key: (hidden)
endpoint: 37.47.2xx:4879
allowed ips: 192.168.6.2/32
latest handshake: 39 minutes, 39 seconds ago
transfer: 199.72 KiB received, 913.50 KiB sentponizej konfigi z routera gargoyle (klient)
root@Gargoyle:/etc/config# cat firewall
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
list network 'lan'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
config zone
option name 'wan'
list network 'wan'
list network 'wan6'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config forwarding
option src 'lan'
option dest 'wan'
config rule
option name 'Allow-DHCP-Renew'
option src 'wan'
option proto 'udp'
option dest_port '68'
option target 'ACCEPT'
option family 'ipv4'
config rule
option name 'Allow-Ping'
option src 'wan'
option proto 'icmp'
option icmp_type 'echo-request'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-IGMP'
option src 'wan'
option proto 'igmp'
option family 'ipv4'
option target 'ACCEPT'
config rule
option name 'Allow-DHCPv6'
option src 'wan'
option proto 'udp'
option src_ip 'fc00::/6'
option dest_ip 'fc00::/6'
option dest_port '546'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-MLD'
option src 'wan'
option proto 'icmp'
option src_ip 'fe80::/10'
list icmp_type '130/0'
list icmp_type '131/0'
list icmp_type '132/0'
list icmp_type '143/0'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Input'
option src 'wan'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
list icmp_type 'router-solicitation'
list icmp_type 'neighbour-solicitation'
list icmp_type 'router-advertisement'
list icmp_type 'neighbour-advertisement'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-ICMPv6-Forward'
option src 'wan'
option dest '*'
option proto 'icmp'
list icmp_type 'echo-request'
list icmp_type 'echo-reply'
list icmp_type 'destination-unreachable'
list icmp_type 'packet-too-big'
list icmp_type 'time-exceeded'
list icmp_type 'bad-header'
list icmp_type 'unknown-header-type'
option limit '1000/sec'
option family 'ipv6'
option target 'ACCEPT'
config rule
option name 'Allow-IPSec-ESP'
option src 'wan'
option dest 'lan'
option proto 'esp'
option target 'ACCEPT'
config rule
option name 'Allow-ISAKMP'
option src 'wan'
option dest 'lan'
option dest_port '500'
option proto 'udp'
option target 'ACCEPT'
config include
option path '/etc/firewall.user'
option reload '1'
config include
option type 'script'
option path '/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'
option family 'any'
option reload '1'
config include 'wireguard_include_file'
option path '/etc/wireguard.firewall'
option reload '1'
config zone 'wg_zone'
option name 'wg'
option device 'wg0'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'ACCEPT'
option mtu_fix '1'
option masq '1'
config forwarding 'wg_lan_forwarding'
option src 'lan'
option dest 'wg'
config forwarding 'lan_wg_forwarding'
option src 'wg'
option dest 'lan'
config redirect 'redirect_enabled_number_0'
option name 'ftp'
option src 'wan'
option dest 'lan'
option family 'ipv4'
option proto 'tcp'
option src_dport '9988-9988'
option dest_port '9988-9988'
option dest_ip '172.16.1.10'
config redirect 'redirect_enabled_number_1'
option name 'ftp'
option src 'wan'
option dest 'lan'
option family 'ipv4'
option proto 'udp'
option src_dport '9988-9988'
option dest_port '9988-9988'
option dest_ip '172.16.1.10'root@Gargoyle:/etc/config# cat network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd95:a904:84cf::/48'
config interface 'lan'
option type 'bridge'
option ifname 'eth1.1'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '172.16.1.1'
option ip6ifaceid '::1'
option dns '1.1.1.1 '
config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'
option ipv6 '0'
option dns '1.1.1.1'
option peerdns '0'
config interface 'wan6'
option ifname 'eth0.2'
option proto 'none'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 0t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5 6t'
config interface 'wg0'
option proto 'wireguard'
option private_key 'xxxx'
option listen_port '51820'
list addresses '192.168.6.4/32'
config wireguard_wg0 'wgserver'
option public_key 'xxx='
list allowed_ips '192.168.1.0/24'
option route_allowed_ips '1'
option endpoint_host 'xxx'
option endpoint_port 'xxx'powtarzam, config wygenerowany dla router gargoyle na telefonie dziala. problem jest tylko klient gargoyle. co moge jeszcze sprawdzic? w tcpdump serwera widac ze komunikacja wpada poprawnie. jest jakby jakis problem z wymiana kluczy.