After a few days I managed to solve default route issue. Below there are my scripts with descriptions.
WG configuration:
/storage/.config/wireguard/wg0.conf
[Interface]
ListenPort = <port>
PrivateKey = <privkey>
[Peer]
PublicKey = <publkey>
AllowedIPs = 0.0.0.0/0
Endpoint = <endpoint hostname>:<port>
Wireguard startup script:
/storage/.config/wgconnect.sh
#!/bin/bash
ip link add dev wg0 type wireguard
ip address add dev wg0 10.0.0.2/24
wg setconf wg0 /storage/.config/wireguard/wg0.conf
ip link set up dev wg0
sleep 5
ip route flush 0.0.0.0/1
ip route flush 128.0.0.0/1
ip route add <first ip which should be routed> via 10.0.0.1
ip route add <second ip which should be routed> via 10.0.0.1
ip route add <third ip which should be routed> via 10.0.0.1
Display More
Stop Wireguard connection:
/storage/.config/wgdisconnect.sh
#!/bin/bash
ip link set down dev wg0
Systemd service:
/storage/.config/system.d/wireguard.service
[Unit]
Description=WireGuard VPN Service
After=network-online.target nss-lookup.target connman-vpn.service time-sync.target
Wants=network-online.target nss-lookup.target connman-vpn.service time-sync.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sleep 5
ExecStart=/storage/.config/wgconnect.sh
ExecStop=/storage/.config/wgdisconnect.sh
[Install]
WantedBy=multi-user.target
Display More
Then all traffic routes via default eth0 interface and several ip's via wg0. Routes look as follows:
$ ip route
default via 192.168.1.1 dev eth0
10.0.0.0/24 dev wg0 scope link src 10.0.0.2
62.179.1.62 via 192.168.1.1 dev eth0
62.179.1.63 via 192.168.1.1 dev eth0
<first routed ip> via 10.0.0.1 dev wg0
192.168.1.0/24 dev eth0 scope link src 192.168.1.19
192.168.1.1 dev eth0 scope link
<second routed ip> via 10.0.0.1 dev wg0
<third routed ip> via 10.0.0.1 dev wg0
Display More
At least, it works for me.