You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
701 B
701 B
add a peer
Say we want to connect two computers via wireguard. We will call them one and two.
manual
On one, run the following command to add a new host:
sudo wg set wg0 peer ${two_pubkey:?} endpoint ${two_public_ip:?}:${two_port:?} allowed-ips ${two_wg_ip:?}/32
if we also want to be able to refer to the host by an easy to remember name rather than just an IP, we can also add it to /etc/hosts
echo -e "${two_wg_ip:?}\t${two_hostname}.wg.alemor.org" >> /etc/hosts
On two, run the same commands but with one and two switched.
automatic
If you can ssh into an account that has sudo access on the host, simply run the wg-addpeer
command included in this repo.