Setting Static IP Address in Ubuntu / Backtrack

As laptop user, we may find that we usually connect to the internet using wifi, modem, or lan cable in public rooms, we usually get an IP address from dhcp, so that we dont need to configure manually our interface address. In some occasion, for example if we want to set our ubuntu to work as a server or to be kept in permanent place we need to set its IP address to static IP.

it can be done by modifiing /etc/network/interfaces file.
for default configuration this will display these lines
(eth0 for lan card
wlan0 for wirelesscard)

auto eth0
iface eth0 inet dhcp

by basic understanding for TCP/IP
u can change it to static configuration by doing this step :
1. Edit /etc/network/interfaces file

#rootbt: nano /etc/network/interfaces

2. Change the default example to these lines

auto eth0
iface eth0 inet static
address 192.168.1.5
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1

3. Save edited file by pressing Ctrl+O
4. Restart Network just to make it sure it works
#rootbt: ifconfig eth0 down
#rootbt: ifconfig eth0 up
#rootbt: /etc/init.d/networking restart

its just example, u need to change all the number according to your own setting, ask your system administrator if you dont have any information about IP address allocation on your workplace.

One thought on “Setting Static IP Address in Ubuntu / Backtrack

Leave a Reply

Your email address will not be published. Required fields are marked *