Configuring FreeBSD network interface

Viewing interfaces

This manual explains how to configure one of interfaces.

First of all, enter the command that will list all interfaces of the server

ifconfig -a

ifconfig output

For example, let's configure em1 interface

Installation of Nano

We will need an editor to make the following settings. Let's install it from the repository.

We will use the editor "nano". Input the following command:

pkg install nano

During the installation process, you will be prompted to agree to continue the installation; Agree

Installation of Nano

Now when the editor is installed, our configuration file can be edited.

Configuring interface

Enter the command:

nano /etc/rc.conf

The editor with the interface configuration file will open; go down to the end of records and enter the following values beginning a new line:

ifconfig_em1=“inet netmask“

add values

Save the changes „Ctrl + O“ and "Enter" , Exit the editor „Ctrl + X“

Start interface

Next, enter the command to restart the network services of our server

service netif restart && service routing restart

command to restart

After successful reboot, re-enter "ifconfig"

re-enter "ifconfig"

The interface we configured is ready for use