summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorDante Catalfamo2020-07-13 23:42:00 -0400
committerDante Catalfamo2020-07-13 23:42:11 -0400
commit4493a029c948f4f2b45d6799aae4cb298883f0d3 (patch)
treef24f5fb51b866f07c6bd972bafaf1accf9f421c6 /content
parent2bec5d9270469da64d2e1a69dcd9805827a229ab (diff)
downloadblog-4493a029c948f4f2b45d6799aae4cb298883f0d3.tar.gz
blog-4493a029c948f4f2b45d6799aae4cb298883f0d3.tar.bz2
blog-4493a029c948f4f2b45d6799aae4cb298883f0d3.zip
gateway: Add static IP section
Diffstat (limited to 'content')
-rw-r--r--content/posts/openbsd-vpn-gateway/index.org25
1 files changed, 24 insertions, 1 deletions
diff --git a/content/posts/openbsd-vpn-gateway/index.org b/content/posts/openbsd-vpn-gateway/index.org
index c96839a..4d363b1 100644
--- a/content/posts/openbsd-vpn-gateway/index.org
+++ b/content/posts/openbsd-vpn-gateway/index.org
@@ -55,7 +55,7 @@ I won't be covering installing OpenBSD here, although it's extremely
simple and straight forward. You can pick up the disk =.iso= image or
USB =.fs= image from the [[https://www.openbsd.org/faq/faq4.html#Download][download]] page on OpenBSD website. If this is
your first time installing OpenBSD, you should check out the
-[[https://www.openbsd.org/faq/faq4.html#Download][installation guide]], which goes over the process in greater detail.
+[[https://www.openbsd.org/faq/faq4.html#Download][installation guide]], which goes over the process in detail.
In this post the machine will have a single network interface called
=vio0= with a desired static IP of =192.168.0.11=, although the
@@ -63,3 +63,26 @@ interface and IP in your case will be different.
The most important thing is to set a static IP, so it can be set as
the gateway for client machines. We'll set this first.
+
+Setting a static IP in OpenBSD couldn't be simpler. For each interface
+on the machine, you can create a file with the name
+=/etc/hostname.<if>=, where =<if>= 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 =dhcp=. We want to give the interface the static IP
+=192.168.0.11=, so we open the file and replace its contents with the
+following.
+
+#+BEGIN_SRC
+inet 192.168.0.11/24
+#+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.
+
+#+BEGIN_SRC shell
+dosa sh /etc/netstat vio0
+#+END_SRC
+
+Now if you check =ifconfig=, you should see the interface has the
+correct IP.