How to configure static IP Address on FreeBSD

www.‮al‬utturi.com
How to configure static IP Address on FreeBSD

To configure a static IP address on FreeBSD, you will need to perform the following steps:

  1. Edit the network configuration file, /etc/rc.conf, and add the following lines, replacing <interface> with the name of your network interface and <static IP address>, <netmask>, and <default gateway> with the appropriate values for your network:
ifconfig_<interface>="inet <static IP address> netmask <netmask>"
defaultrouter="<default gateway>"
  1. Save the changes to the configuration file and exit the text editor.

  2. Restart the network service to apply the changes:

service netif restart
  1. Verify that the static IP address has been correctly configured by using the ifconfig command:
ifconfig <interface>

Alternatively, you can use the ip command to view the network configuration:

ip addr show <interface>
Created Time:2017-10-28 21:39:00  Author:lautturi