Hi guys. Finally i managed to run server and client on two mikrotik devices. Thanks for all of you. But now I'm wondering if there is any possibility to use more than one peer with one server? The thing is - once I add another peer to the server's config file, everything stops working even if only one peer connected to the server. Any ideas on what may happen and how can I fix it? Or I just want too much?
Here are the config files:
server.conf
[Interface]
Address = 10.0.0.1/32
PrivateKey = 8N4VDweB+y7cbNhw7Ays1wCw2+4R8TV2sR1e2So7Z0c=
MTU = 1440
ListenPort = 51820
Jc = 4
Jmin = 50
Jmax = 1000
S1 = 146
S2 = 42
H1 = 532916466
H2 = 2096090865
H3 = 406337014
H4 = 57583056
# Add IP masquerading
PostUp = iptables -t nat -A POSTROUTING -o awg-server-veth -j MASQUERADE
# Del IP masquerading
PostDown = iptables -t nat -D POSTROUTING -o awg-server-veth -j MASQUERADE
Table = awg
PostUp = ip rule add priority 300 from all iif awg-server-veth lookup awg || true
PostDown = ip rule del from all iif awg-server-veth lookup awg || true
[Peer]
PublicKey = 9+VoCywnwi2N6/8+5zTwJAVwwnV4+rsZfFPR70L+uBw=
AllowedIPs = 0.0.0.0/0
#[Peer]
#PublicKey = +XyH+Tex55ERoc7qm21CgaRaV+N2clTfSHHLlkPFOlk=
#AllowedIPs = 0.0.0.0/0
client_01.conf
[Interface]
Address = 10.0.0.2/32
PrivateKey = AFc6t48DkSxI32ESsaG8XX7490hJ7aLUNQ8DCfqd430=
MTU = 1440
Jc = 4
Jmin = 50
Jmax = 1000
S1 = 146
S2 = 42
H1 = 532916466
H2 = 2096090865
H3 = 406337014
H4 = 57583056
# Add IP masquerading
PostUp = iptables -t nat -A POSTROUTING -o vpn_chr_out_awg -j MASQUERADE
# Del IP masquerading
PostDown = iptables -t nat -D POSTROUTING -o vpn_chr_out_awg -j MASQUERADE
Table = awg
PostUp = ip rule add priority 300 from all iif vpn_chr_out_awg lookup awg || true
PostDown = ip rule del from all iif vpn_chr_out_awg lookup awg || true
[Peer]
PublicKey = sCVHs/enY5vuQh+vA2AdSU3EK2aTvpIqpTCjg35NDCY=
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1
Endpoint = IP_ADDRESS:51820
client_02.conf
[Interface]
Address = 10.0.0.3/32
PrivateKey = ICAs87JwSdTdlzHZswF/8SM2xemn5QhgCYNXtjKqClE=
MTU = 1440
Jc = 4
Jmin = 50
Jmax = 1000
S1 = 146
S2 = 42
H1 = 532916466
H2 = 2096090865
H3 = 406337014
H4 = 57583056
# Add IP masquerading
PostUp = iptables -t nat -A POSTROUTING -o vpn_chr_out_awg -j MASQUERADE
# Del IP masquerading
PostDown = iptables -t nat -D POSTROUTING -o vpn_chr_out_awg -j MASQUERADE
Table = awg
PostUp = ip rule add priority 300 from all iif vpn_chr_out_awg lookup awg || true
PostDown = ip rule del from all iif vpn_chr_out_awg lookup awg || true
[Peer]
PublicKey = sCVHs/enY5vuQh+vA2AdSU3EK2aTvpIqpTCjg35NDCY=
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1
Endpoint = IP_ADDRESS:51820