FreeBSD: How To Start / Restart / Stop Network and Routing Service
FreeBSD is a Unix-like free operating system. You can install to choose third party software on FreeBSD from the Ports Collection. Many services such as POP3 server daemons, IMAP, etc. could be started using the inetd.
However, networking can be stop or started using special script located in /etc/rc.d/ directory. This directory includes script to stop or start network, and other services such as SSH server.
FreeBSD 5.x/6.x and above version - start or stop network
FreeBSD 5.x/6.x and above version comes with netif script to start, restart, stop network service. You need to login as a root user. Then you can use following commands:
To start FreeBSD network service:
# /etc/rc.d/netif start
To stop FreeBSD network service:
# /etc/rc.d/netif stop
To restart FreeBSD network service:
# /etc/rc.d/netif restart
Manual method using ifconfig
To stop network card (NIC) on-fly:
# ifconfig network-interface down
To start network card (NIC) on fly:
# ifconfig network-interface up
To list down network interface:
# ifconfig -d
To list up network interface:
# ifconfig -u
FreeBSD Update / restart routing tables / service
It is also necessary to update routing table after restating networking service, enter:
# /etc/rc.d/routing restart
How do I restart network service over ssh session?
You need to type the commands as follows in order to avoid any problems:
# /etc/rc.d/networking restart && /etc/rc.d/routing restart
FreeBSD 4.x and prior version only - start, restart, stop network service
1) To start network service under FreeBSD you need to copy special
script as follows:
# cp /usr/share/examples/etc/netstart /etc/network
2) Execute script:
. /etc/network
OR
sh /etc/network
Please note that script will do all necessary work for you i.e. it will start network, routing, firewall etc.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- BSD start services
- Linux: How to write a System V init script to start, stop, and restart my own application or service
- FreeBSD How to restart inetd service / daemon
- Start and stop VMWARE VPS / virtual machine guest operating system from command line
- FreeBSD Setup 2 IP address on One NIC ( IP alias )
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: /etc/rc.d/netif, /etc/rc.d/routing, /usr/share/examples/etc/netstart, freebsd /etc/network, freebsd /usr/share/examples/etc/netstart, freebsd network interface, freebsd restart networking, freebsd restart routing, ifconfig network-interface, start interface freebsd



Whats the difference between /etc/netstart and /etc/rc.d/netif for restarting networking?
/etc/netstart is old method and does not support all the options (like stop, restart etc), which is now supported by /etc/rc.d/netif script. Ease of use is main difference between two.
Thank you very mach