# ip -4 address show dev wg0
13: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1420 qdisc noqueue state UNKNOWN group default qlen 1000
inet 192.168.11.2/24 brd 192.168.11.255 scope global wg0
valid_lft forever preferred_lft forever
# ping 192.168.11.1 -c 3
PING 192.168.11.1 (192.168.11.1): 56 data bytes
64 bytes from 192.168.11.1: seq=0 ttl=64 time=83.061 ms
64 bytes from 192.168.11.1: seq=1 ttl=64 time=82.381 ms
64 bytes from 192.168.11.1: seq=2 ttl=64 time=82.321 ms
--- 192.168.11.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 82.321/82.587/83.061 ms
# ping -I wg0 1.1.1.1 -c 3
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=60 time=84.100 ms
64 bytes from 1.1.1.1: seq=1 ttl=60 time=83.621 ms
64 bytes from 1.1.1.1: seq=2 ttl=60 time=83.660 ms
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 83.621/83.793/84.100 ms
# ping -I 192.168.11.2 1.1.1.1 -c 3
PING 1.1.1.1 (1.1.1.1) from 192.168.11.2: 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=60 time=25.960 ms
64 bytes from 1.1.1.1: seq=1 ttl=60 time=25.760 ms
64 bytes from 1.1.1.1: seq=2 ttl=60 time=25.860 ms
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 25.760/25.860/25.960 ms
wg0 is not default route. I expected that when pinging using the ip address of vpn interface as the source, traffic will go through the vpn interface. This is bug or am I wrong?
No, it will go via the default gateway with the specified source IP address.
If you want it to go out of the vpn interface, you need to use the vpn interface as source, like you did in the mikrotik and in the second ping.
OpenWrt utilizes source-routing for IPv6 default route by default.
So the paths for local and forwarded traffic may differ, as well as the paths for different sources.
default from 2a02:2698:9024:9af8::/64 via fe80::ea4:2ff:fe90:2c01 dev pppoe-wan proto static metric 512 pref medium
2a02:2698:9024:9af8::/64 dev br-lan proto static metric 1024 pref medium
unreachable 2a02:2698:9024:9af8::/64 dev lo proto static metric 2147483647 error 4294967148 pref medium
fd22:1111:1111::/64 dev br-lan proto static metric 1024 pref medium
fd22:11111:1111:10::/60 dev wg0 proto kernel metric 256 pref medium
unreachable fd22:1111:1111::/48 dev lo proto static metric 2147483647 error 4294967148 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0.2 proto kernel metric 256 pref medium
fe80::/64 dev br-lan proto kernel metric 256 pref medium
fe80::/64 dev gre4-gre0 proto kernel metric 256 pref medium
fe80::/64 dev wlan1 proto kernel metric 256 pref medium
fe80::/64 dev wlan0 proto kernel metric 256 pref medium
fe80::/10 dev pppoe-wan metric 1 pref medium
fe80::/10 dev pppoe-wan proto kernel metric 256 pref medium
'OPTIONAL_PREFIX' need to be my value? Anyway i didn't understand why 'ip -6 route get' doesn't work. I have native ipv6 via dhcp-pd.
# ip -6 route get 2001:4860:4860::8888
2001:4860:4860::8888 from :: via fe80::ea4:2ff:fe17:7801 dev pppoe-wan proto static src 2a02:2698:9023:40a4::1 metric 1024 pref medium
But i can't save this config because all these addresses is dynamic.
Is this the wrong configuration from openwrt or my ISP?