Home arrow FreeBSD Tips arrow FreeBSD Network Tips
FreeBSD Network Tips PDF
Sunday, 10 August 2008

Here is a list with FreeBSD Network Tips, useful when you configure a FreeBSD server or router, and when you troubleshoot your network.

Tip1. See if you have errors/collisions on your FreeBSD router network cards :
---------------------------------------------------------------------------------------------------
netstat -ni                         #
look at values for: Ierrs, Oerrs and Coll.
netstat -w 2 -I em0          # refresh this info every few seconds (-w 2 for two seconds):


Tip2. See your network routes on FreeBSD router:
-------------------------------------------------------------
netstat -nr



Tip3.
See active connections to your FreeBSD router:
----------------------------------------------------------------
netstat -p tcp


Tip 4. See more statistics about your network interfaces:
---------------------------------------------------------------------
netstat -s
netstat -s -p



Tip 5. Display network memory buffer size:
----------------------------------------------------
netstat -m


Tip 6.
Check if you have hardware link (conectivity) with desktop computer from FreeBSD router:
---------------------------------------------------------------------------------------------------------------------
arp -a


Tip 7. Use arping to see if an IP is already asignet on a computer on your subnet:
---------------------------------------------------------------------------------------------------
Arping will querry the subnet and return IP / MAC - hardware address of that machine.
arping 192.168.0.2



Tip 8. View active socket connections:
-----------------------------------------------
netstat -AanW -p tcp



Tip 9. See traffic count in bytes on a network card interface:
-------------------------------------------------------------------------
netstat -I em0 -b



Tip 10. Adding an IP alias to a network card:
-----------------------------------------------------
ifconfig em0 192.168.0.2 netmask 255.255.255.0 alias

To delete an alias:
ifconfig em0 192.168.0.2 -alias

Note
to tip 10: On FreeBSD you are not allowed to have multiple IPs from the same subnet on the same network card unless, first IP has his own netmask (for example 255.255.255.0) and all other IPs added as alias are all configured with 255.255.255.255 netmask.

To make alias permanent after reboot add the following line to /etc/rc.conf:

ifconfig_em0_alias0="inet 192.168.0.2 netmask 255.255.255.0"


Use alias1, alias2 and so on if you want to add multiple IP aliases.


Tip 11. Find what types of media connections support your network card:
-----------------------------------------------------------------------------------------------------
ifconfig -m em0



Last Updated ( Sunday, 10 August 2008 )
 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?