wireguard
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wireguard [2021/02/23 07:38] – [Create Key Pairs] baumi | wireguard [2021/05/09 10:31] (current) – [Assign Link Network to Wireguard-Tunnel] baumi | ||
|---|---|---|---|
| Line 13: | Line 13: | ||
| **Host A** | **Host A** | ||
| < | < | ||
| - | # wg genkey > privateA | + | root@hosta |
| - | # wg pubkey < privateA > publicA | + | root@hosta |
| </ | </ | ||
| **Host B** | **Host B** | ||
| < | < | ||
| - | # wg genkey > privateB | + | root@hostb |
| - | # wg pubkey < privateB > publicB | + | root@hostb |
| </ | </ | ||
| - | {{tag>kb linux}} | ||
| ===== Assign Link Network to Wireguard-Tunnel ===== | ===== Assign Link Network to Wireguard-Tunnel ===== | ||
| - | Link-Network: | + | |
| - | HostA: 172.24.0.1/ | + | HostA: 172.24.0.1/ |
| - | Host2: 172.24.0.2/ | + | HostB: 172.24.0.2/ |
| ===== Create Config ===== | ===== Create Config ===== | ||
| **Host A** | **Host A** | ||
| < | < | ||
| - | # cat / | + | root@hosta |
| + | # HostA - HostB | ||
| [Interface] | [Interface] | ||
| Address = 172.24.0.1/ | Address = 172.24.0.1/ | ||
| Line 45: | Line 45: | ||
| **Host B** | **Host B** | ||
| < | < | ||
| - | # cat / | + | root@hostb |
| + | # HostB - HostA | ||
| [Interface] | [Interface] | ||
| Address = 172.24.0.2/ | Address = 172.24.0.2/ | ||
| Line 55: | Line 56: | ||
| AllowedIPs = 172.24.0.1/ | AllowedIPs = 172.24.0.1/ | ||
| # Uncomment if HostB is behind NAT Router | # Uncomment if HostB is behind NAT Router | ||
| - | # | + | # PersistentKeepAlive = 25 |
| </ | </ | ||
| + | ===== Start Wireguard Tunnel ===== | ||
| + | Issue on both hosts | ||
| + | < | ||
| + | root@hosta # wg-quick up wg0 | ||
| + | root@hostb # wg-quick up wg0 | ||
| + | </ | ||
| + | ===== Check Status ===== | ||
| + | **Host A** | ||
| + | < | ||
| + | root@hosta # wg | ||
| + | interface: wg0 | ||
| + | public key: PUBLIC-KEY-A | ||
| + | private key: (hidden) | ||
| + | listening port: 51820 | ||
| + | peer: PUBLIC-KEY-B | ||
| + | endpoint: 185.69.244.140: | ||
| + | allowed ips: 172.24.0.2/ | ||
| + | latest handshake: 1 minute, 44 seconds ago | ||
| + | transfer: 2.80 MiB received, 1.09 MiB sent | ||
| + | </ | ||
| + | |||
| + | **Host B** | ||
| + | < | ||
| + | root@hostb # wg | ||
| + | interface: wg0 | ||
| + | public key: PUBLIC-KEY-B | ||
| + | private key: (hidden) | ||
| + | listening port: 51820 | ||
| + | |||
| + | peer: PUBLIC-KEY-A | ||
| + | endpoint: 144.76.72.57: | ||
| + | allowed ips: 172.24.0.1/ | ||
| + | latest handshake: 21 seconds ago | ||
| + | transfer: 1006.68 KiB received, 2.57 MiB sent | ||
| + | persistent keepalive: every 25 seconds | ||
| + | </ | ||
| + | {{tag>kb linux}} | ||
wireguard.1614062339.txt.gz · Last modified: by baumi
