From 9affebdd8db38915ce7f5b025bd6e7b4c096c532 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Fri, 28 Aug 2020 15:45:19 -0400 Subject: vpn-gateway: Add mygate configuration --- content/posts/openbsd-vpn-gateway/index.org | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'content') diff --git a/content/posts/openbsd-vpn-gateway/index.org b/content/posts/openbsd-vpn-gateway/index.org index 0d4496e..216eb65 100644 --- a/content/posts/openbsd-vpn-gateway/index.org +++ b/content/posts/openbsd-vpn-gateway/index.org @@ -38,7 +38,8 @@ In this post the machine will have a single network interface called =vio0=. We'll set it up with a static IP of =192.168.0.11= and a - =/24= subnet. The interface and IP in your case will differ. + =/24= subnet. Our network's router is located at =192.168.0.1=. The + interface and IPs in your case will differ. * Hardware @@ -82,18 +83,27 @@ interface on the machine, you can create a [[http://man.openbsd.org/man5/hostname.if.5][=hostname.if(5)=]] file with the name =/etc/hostname.=, where == is the name of the interface. Since we want to set a configure the interface =vio0=, - the file we want is =/etc/hostname.vio0=. If your box was configured - with DHCP, the file might contain a single line saying =dhcp=. We - want to give the interface the static IP =192.168.0.11= with a =/24= - subnet. We use [[https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing][CIDR notation]] here for convenience, but it's also - possible to write out the full subnet mask after our IP, separated - by a space. We open the file and replace its contents with the - following. + the file we want is =/etc/hostname.vio0=. + + If your box was configured with DHCP, the file might contain a + single line saying =dhcp=. We want to give the interface the static + IP =192.168.0.11= with a =/24= subnet. We use [[https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing][CIDR notation]] here for + convenience, but it's also possible to write out the full subnet + mask after our IP, separated by a space. We open the file and + replace its contents with the following. #+BEGIN_SRC inet 192.168.0.11/24 #+END_SRC + We'll also need to enter the IP of our network's router into the + [[https://man.openbsd.org/man5/myname.5][=mygate(5)=]] file at =/etc/mygate=. + + #+BEGIN_SRC + 192.168.0.1 + #+END_SRC + + Now we run [[https://man.openbsd.org/man8/netstart.8][=netstart(8)=]] to reconfigure the interface according to the file we've just edited. -- cgit v1.2.3