saski4711 Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 24 Jun 2004 Posts: 202
|
Posted: Tue Dec 05, 2023 4:57 pm Post subject: wireguard routing questions |
|
|
Hi there,
I'm trying to connect to Nordvpn via kernel wireguard. It seems that the connection comes up but I'm stuck with routing.
my wg0.conf looks like this:
Code: |
[Interface]
PrivateKey = NOT4YOU
Address = 10.5.0.2/32
DNS = 10.5.0.1
[Peer]
PublicKey = NOT4YOU
AllowedIPs = 0.0.0.0/0
Endpoint = 185.104.184.3:51820
PersistentKeepalive = 25
|
after firng up wg-quick up wg0.conf I see the following:
Code: |
wg-quick up /etc/wireguard/wg0.conf
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.5.0.2/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] nft -f /dev/fd/63
|
wg shows:
Code: |
wg
interface: wg0
public key: NOT4YOU
private key: (hidden)
listening port: 55835
fwmark: 0xca6c
peer: NOT4YOU
endpoint: 185.104.184.3:51820
allowed ips: 0.0.0.0/0
transfer: 0 B received, 296 B sent
persistent keepalive: every 25 seconds
|
Not I'm stuck with routing:
Code: |
ip route
default via 192.168.2.1 dev eth0 proto dhcp src 192.168.2.106 metric 100
185.104.184.3 via 192.168.2.1 dev eth0
192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.106 metric 100
|
I thought wg-quick would set the routing. Also tried with NetworkManager. No routing will be added.
I'm not experienced with iptables at all so I'd apprechiate any advice on how to proceed from here. Thanks in advance. |
|