Home Linux & Systems Cybersecurity Cloud & DevOps Networks & Infrastructure SIEM & Monitoring DFIR & Threat Intel Development & Other All categories Projects About Tools

Configure network interface in BSD

Leer en espanol
Configure network interface in BSD

Table of contents

FreeBSD To set the address ===

To configure a static IP, gateway and DNS in BSD is very simple, this time we are going to see how to configure the network interface in FreeBSD and OpenBSD.

FreeBSD

To configure the IP addressing and the gateway we must add the following to the file /etc/rc.conf

Bash
ifconfig_em0=»inet 192.168.1.110 netmask 255.255.255.0″

defaultrouter=»192.168.1.1″

To configure DNS resolution is in /etc/resov.conf

text
search red-orbita.com

nameserver 192.168.1.10

nameserver 192.168.1.11

We restart the network service

text
/etc/rc.d/netif restart

OpenBSD

In the case of OpenBSD, to configure IP addressing we must add the following in /etc/hostname.em0

Bash
cat /etc/hostname.em0
inet 192.168.1.110 255.255.255.0 192.0.0.255

To configure the gateway we create the file /etc/mygate

Bash
cat /etc/hostname.em0

192.168.1.1

To configure DNS resolution is in /etc/resov.conf

text
search red-orbita.com

nameserver 192.168.1.10

nameserver 192.168.1.11

lookup file bind

We restart the network service

text
sh /etc/netstart

all the best.

:wq!

Comments