Monday, December 21, 2009

How to enable SSHD in FreeBSD

Actually you will be asked whether to enable SSH, during a Standard Installation of FreeBSD.

Now, if you need to enable SSH after an installation, open the file rc.conf and add the line ` sshd_enable="YES" `.
open the file
# vi /etc/rc.conf
Now add the below line to the file.
sshd_enable="YES"
Now start sshd.
# /etc/rc.d/sshd start 

Tuesday, December 8, 2009

How to display free disk space of drives (hard disk)

The df utility displays statistics about the amount of free disk space on the specified file system or on the file system of which file is a part. Values are displayed in 512-byte per block counts. If neither a file or a file system operand is specified, statistics for all mounted file systems are displayed.

Use df -h to see the output "Human-readable" output. Uses unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.
 # df -h 
Example:
# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/ad4s1a 23G 2.8G 19G 13% /
devfs 1.0K 1.0K 0B 100% /dev

Sunday, December 6, 2009

How to set up (create) an alias ip for an interface in FreeBSD

You can easily set up an alias ip alias for an interface using the command line utility ifconfig .

The bellow command shows how to set an alias ip to the interface rl0.
# ifconfig rl0 192.168.3.1 netmask 255.255.255.255 alias
Substitute rl0 with your desired inteface and 192.168.3.1 with your desires ip.
Now if you want this configuration to be "persistent across boot" then you will need to edit the file /etc/rc.conf to setup persistent ip aliasing option by appending a configuration line, so that next time FreeBSD comes up (after restart/shutdown) it will create alias for you:
Open the file
# vi /etc/rc.conf
Append the following line.
ifconfig_rl0_alias0="inet 192.168.3.1 netmask 255.255.255.255"
replace rl0 and 192.168.3.1 with your desired values.

Friday, December 4, 2009

How to create a Permanent or Static ip in Freebsd

You can add an ip to an interface after boot using ifconfig.
example: ifconfig rl0 192.168.1.1
But this ip wont last for the next boot.

So if you want to make an permanent ip for an interface just follow these steps.

1. Open up the file rc.conf
# vi /etc/rc.conf
2. Now add the following line
ifconfig_interface="inet 192.168.1.1 netmask 255.255.255.0"  
substitute interface with your interface(eg:rl0,rl1,fxp0,em0..)
substitute 192.168.1.1 with your desired lan ip.
Now type <ESC>:wq to save and exit
3. Now Restart your network.
# /etc/rc.d/netif restart && /etc/rc.d/routing restart

 
 

Labels

Labels