Networking
21 June 2011 6 Comments

The DHCP Protocol for IPv4 Explained

Introduction

The Dynamic Host Configuration Protocol (DHCP) is an automatic configuration protocol used on IP networks [RFC 2131]. A major advantage is that it eliminates the need to manually assign each host a static IP address. Hosts can ‘ask’ to join a network and they will be assigned an IP, and provided with additional information such as the subnetmask and gateway IP.

There are two versions of DHCP, one for IPv4 and one for IPv6. While both versions bear the same name and perform much the same purpose, the details of the protocol for IPv4 and IPv6 are sufficiently different that they can be considered separate protocols. In this article we explain the DHCP for IPv4 protocol and its packets.

How It Works

A client initially knows nothing about the network is it joining, so it needs to contact the DHCP server to request an IP address and receive other network information such as the subnetmask and the address of the DNS server. However, the MAC and IP address of the DHCP server are initially unknown to the client as well. So how can the new client contact the DHCP server, if it doesn’t know its location?

To solve this bootstrap problem the DHCP protocol uses special broadcast…

Tags: , dhcpdiscover, dhcpoffer, dhcprequest, , router, switch
Linux
16 June 2011 0 Comments

Getting your Network Connection Up And Running on Backtrack

By default, networking is disabled in Backtrack 4. The reason for this is that stealth is an important factor in penetration testing, so a system that starts sending out noisy DHCP requests after booting can be a bad thing.

Enabling networking

The easiest way to enable networking is to use the init script:

/etc/init.d/networking start

This will attempt to start the network interfaces in the file /etc/network/interfaces. Generally you don’t need to worry about the file’s contents; all relevant network interfaces will be enabled automatically and a DHCP lookup will start. If you are not using a wireless network card this is probably all you need to do. The rest of this page describes tools for a more manual approach.

Usually, your physical network card will be called eth0, and your wireless network card will be called wlan0.

ifconfig

Ifconfig is used to configure network interfaces. Without arguments, ifconfig shows the currently active interfaces:

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:01:40:A4:b1:92
          inet addr:120.89.168.243  Bcast:120.89.175.255  Mask:255.255.240.0
          inet6 addr: 2001:610:1948:8000:211:50ff:fd34:b192/64 Scope:Global
          inet6

Tags: , , eth0, , , wicd, wicd-client, , wpa_supplicant