Configuring Network on FreeBSD
Operating System | FreeBSD 9 |
Website | FreeBSD Website |
Introduction
The network is an essential part of system configuration, so I’ll cover some aspects of it here.
Configuration
Display Interfaces and Associated IPs
The command is always the same:
|
|
Declare Interfaces
We can declare the interfaces to manage at startup by simply listing the interfaces separated by spaces:
|
|
Here I’ve declared 4 interfaces and configured lo0.
DHCP
If you want to set an interface to use DHCP, it’s very simple:
|
|
Here my vr0 interface is configured with DHCP.
Static IPs
If you want to set a static IP address to an interface, it’s very simple:
|
|
Here my vr0 interface is configured with a static IP.
Default Gateway
To configure the default gateway:
|
|
Display Routes
To display routes:
|
|
Add a Route
To add a route, simply define one or more route names and define them line by line:
|
|
Restart Network Services
To restart network services:
|
|
And for routing services:
|
|
References
http://www.freebsd.org/doc/fr/articles/ppp/chap3.html
http://www.cyberciti.biz/faq/freebsd-setup-default-routing-with-route-command/
Last updated 02 Jul 2012, 10:07 CEST.