This tutorial demonstrates how to configure a network connection in Linux (Backtrack specifically). Normally a network connection can be automatically established and configured but in some situations this isn’t the case. In such instances, an IP, Gateway, Subnet Mask, and DNS must be assigned the the network adapter. This tutorial will also show how to configure a wireless adapter to connect to a desired network. – Commands Used: ifconfig (Shows a listing of recognized network interfaces on the system) sudo ifconfig [INTERFACE] up (Enables the specified network interface) sudo ifconfig [INTERFACE] [IP ADDRESS] netmask [SUBNET MASK] (Assigns an IP Address to the network interface. A LAN IP should begin with 192.168.xxx.xxx [EX: 192.168.0.112]. Netmask will assign a subnet mask to the interface as well which is normally 255.255.255.0) sudo iwconfig [INTERFACE] mode managed (Sets the interface to managed mode) sudo iwconfig [INTERFACE] essid [NAME OF NETWORK] key [ENCRYPTION KEY] (Connects you to the specified secure network) sudo route add default gateway [GATEWAY IP ADDRESS] (Assigns the default gateway to the interface. This will be the IP Address of your router which varies from model to model. Most will be either 192.168.0.1 or 192.168.1.1) sudo sh -c “echo nameserver [DNS IP] [GREATER THAN SYMBOL] /etc/resolv.conf” (This writes the DNS IP to your resolv.conf file. This is needed to resolve domain names to IP addresses. Your DNS will either be assigned by your ISP …
Read this article:
Setting up a Network Connection in Linux (Backtrack)