Sunday, March 7, 2010

Debian 19

DHCP uses port UDP:68 to request address information from the server. The server replies using UDP:67. DHCP lease information are stored in:/var/lib/dhcp3/dhclient.eth0.leases

To force a DHCP renew, use:

DHClient renews all interfaces by default, ignoring non-broadcast interfaces if possible. You can also specify interfaces like this:
dhclient eth0

To use ifconfig to reveal all interfaces, use:
ifconfig -a

To use ifconfig to set up interface, use:
ifconfig eth0
ifconfig eth0 netmask
route add default gw
ifconfig eth0 up

You can also configure sub-interfaces, like this:
ifconfig eth0:1

When Debian first starts, it reads:

The file contains the available interfaces and how to configure them.

To permanently switch an interface to use static address, modify /etc/network/interfaces. You should see the following code:
iface eth0 inet dhcp

Change it to:
iface eth0 inet static

We can also add additional nameservers by modifying /etc/resolv.conf:

You can also use ifup and ifdown to bring an interface up or down like this:
ifup eth0
ifdown eth0

Use the -a parameter to bring all up or down, like this:
ifdown -a

No comments :

Post a Comment