NetBSD

Operating System6.0.1
WebsiteNetBSD Website

Introduction

The network is an essential part of system configuration. I will cover some aspects of it here.

Configuration

Display Interfaces and Associated IPs

Here’s the command:

1
ifconfig

Static IPs

We can declare interfaces persistently:

1
2
3
4
5
6
[...]
# Add local overrides below
#
ifconfig_vr0="inet 192.168.0.254 netmask 255.255.255.0" # Wan
ifconfig_vr1="inet 192.168.1.254 netmask 255.255.255.0" # DMZ
[...]

You add an ifconfig entry with the interface name, followed by its parameters.

Gateway

It’s possible to set the gateway like this:

1
2
3
[...]
defaultroute="192.168.0.138"
[...]

Or alternatively:

1
192.168.0.138

Restart Network Services

1
/etc/rc.d/network restart

Last updated 15 Mar 2013, 22:32 CET. history