Thursday, July 25, 2013

Set Static IP in OpenBSD

Run the following commands:
$ ifconfig -a

Look for the interface right after "lo0". We will use interface em0 as an example. 

$ cd /etc

Look for the file "hostname.<interface>. This is the file we need to edit. In our example:
$ sudo vi hostname.em0

Comment out "dhcp". Based on our example's network settings, my hostname.em0 now looks like this:
inet NONE

Save and exit, then reboot or restart your network for the changes to take effect.
Restarting the network:
# sh /etc/netstart

$ ifconfig -a

In our example, the em0 interface should display an IP address of

Courtesy of:

No comments:

Post a Comment