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. 

Next:
$ 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:
#dhcp
inet 192.168.1.4 255.255.255.0 NONE

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

Verification:
$ ifconfig -a

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

Courtesy of:

No comments:

Post a Comment