Archive for June, 2007

How to change IP address or setup new ip address to existing NIC in FreeBSD

Tuesday, June 12th, 2007

1) Use ifconfig command as follows:
ifconfig interface inet IP

Example(s):
ifconfig fxp0 inet 192.168.1.5

Note fxp0 is Ethernet interface name can be Obtained using ifconfig -a command.

2) To setup up ip permanently open file /etc/rc.conf ; add/modify network entries:
vi /etc/rc.conf

And setup values as follows:
hostname=”box1.freebsd.org.in”
ifconfig_fxp0=”inet 192.168.1.6 netmask 255.255.255.0″

Note ifconfig_fxp0 is Ethernet interface name can be Obtained using ifconfig -a command.

3) Again re-run /etc/netstart script.

How to add multiple IP to a single NIC in FreeBSD

Tuesday, June 12th, 2007

FreeBSD allows you creat alias or assign multiple ip address to single NIC (network interface card)

My setup:
fxp0 - IP : 192.168.1.1/255.255.255.0
fxp0 alias - IP : 192.168.1.5/255.255.255.255

Note: Netmask must be diffrent otherwise you will get an error ifconfig: ioctl (SIOCAIFADDR): File exists

A) From command line use ifconfig command as follows:
# ifconfig fxp0 192.168.1.5 netmask 255.255.255.255 alias

B) You can setup this alias in /etc/rc.conf file by appending following text, so that next time FreeBSD comes up (after restart/shutdown) it will create alias for you:
ifconfig_fxp0_alias0=”192.168.1.5 netmask 255.255.255.255″

C)Restart FreeBSD network service using following script:
# /etc/netstart

D) Display alias and real ip using ifconfig lnc0 command:
# ifconfig fxp0
lnc0: flags=8843 mtu 1500
inet6 fe80::20c:29ff:fe01:ddbd%lnc0 prefixlen 64 scopeid 0×1
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffff

Read ifconfig man page.

FreeBSD India Forums Launched

Sunday, June 10th, 2007

We have now launched FreeBSD India Forum. You can visit our forums at

http://forums.freebsdindia.com

Please register yourself in forums and do post in it.

Installing a Proxy Server on FreeBSD - Privoxy

Saturday, June 9th, 2007

Setting up proxy on a FreeBSD server is very easy and helps to create a secure environment for your network, and also allows your whole network to access internet using a single internet connection.
Privoxy is a good proxy server. It’s very easy to use and worked well.

Installation
# cd /usr/ports/www/privoxy
# make install clean
# rehash

The configuration file is /usr/local/etc/privoxy/config, there is one line which must be changed:
listen-address 192.168.0.1:8119
The IP should be changed to your server’s internal LAN IP address. Also, it’s better to use a non-default port number for security reasons.