Forum

wireguard: can't re...
 
Powiadomienia
Wyczyść wszystko

wireguard: can't reach another host in wireguard server network

1 Wpisy
1 Użytkownicy
0 Reactions
744 Widoki
0
Rozpoczynający temat

Can't reaach any other host where wireguard server if part of internal network (LAN).

1 odpowiedź
0
Rozpoczynający temat

remember:

eth0 - this is my network interface, change it if needed

1. Add this lines in wg0.conf:

[Interface]
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

or run one the command for testing purposes like this one below

iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

2. Modify clients WG config in this way (adjust to your needs if necessary):

[Peer]
AllowedIPs = 192.168.99.0/24, 192.168.30.0/24

3. Enable net.ipv4.ip_forward = 1 on WG server.

how to edit:

  1. type "nano /etc/sysctl.conf"
  2. find #net.ipv4.ip_forward=1 and change it to net.ipv4.ip_forward=1 removing # character
  3. reload sysctl using "sysctl -p" command
Ten wpis został zmodyfikowany 1 rok temu 5 razy przez mrmucha

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: