Skip to content
Tags

, ,

DHCP, FTP & SSH Servers

March 21, 2011

DHCP Server

DHCP stands for Dynamic Host Control Protocol and with this protocol a new host on the network can issue a request for IP information. The DHCP server will then provide the host with all of the necessary information it needs to communicate on the network, such as its IP address and netmask and the gateway and DNS servers to use. To install the DHCP server software dhcp3-server:

# apt-get install dhcp3-server

After installation the DHCP server will give an error and will not start, this is normal as we need to first configure the server settings. Here is the topology that we will be using:

Note: Please set your server and desktop VMs to “Bridged Mode”

Next we need to setup a static IP address for the DHCP server. We will need to edit the /etc/network/interfaces file.

# nano /etc/network/interfaces

This file should look as follows:  First we see the loopback network interface,

auto lo
iface lo inet loopback

then the primary network interface,

auto eth0
iface eth0 inet dhcp

Comment out the line iface eth0 inet dhcp and replace with the following lines:

iface eth0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1

Next, edit the DHCP configuration file /etc/dhcp3/dhcpd.conf. First make a backup copy:

# cp /etc/dhcp3/dhcpd.conf  dhcpd.backup
# nano /etc/dhcp3/dhcpd.conf

Next we will need to write a subnet declaration, a listing of the IP addresses the DHCP server will hand out to client systems. The file comes with sample subnet declarations; the easiest way to write your own is to remove the comment marks (the # marks) from the lines and enter in your own values. Here, for instance, is what a subnet declaration would look like for a network segment addressed 192.168.1.0, with a subnet mask of 255.255.255.0, with the DHCP server configured to use an address range from 192.168.1.1 to 192.168.1.100:

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.2, 192.168.1.3;
default-lease-time 6000;
max-lease-time 72000;
}

You can use static DHCP assignments along with a dynamic DHCP subnet declaration if you want. If a server matches a static assignment, it will get that address; otherwise it will default with an address in the dynamic range. Each host that gets a static assignment needs its own host declaration. For instance, here is a host declaration for a host with a MAC address of 00:1f:f3:50:de:14 that will be assigned 10.1.1.10:

host myserver {
hardware ethernet 00:0c:c0:ff:ee:00;
option host-name "myserver";
fixed-address 192.168.1.20;
}

Next you will need to edit one more file, the /etc/default/dhcp3-server file, to configure which network interfaces the DHCP server will listen on for client requests:

# nano /etc/default/dhcp3-server

Once editing the file, look for the line marked INTERFACES. You’ll need to edit that to allow the DHCP server to listen for requests on your system’s Ethernet card, which is usually eth0:

INTERFACES=”eth0″

Save the file, exit your text editor, and reboot your Ubuntu 10.10 Maverick Meerkat system. Once the system restarts, you can launch the DHCP server with this command:

# /etc/init.d/dhcp3-server start
or
# service dhcp3-server start
# service dhcp3-server restart
# service dhcp3-server stop

FTP Server

File Transfer Protocol (FTP) is a TCP protocol for uploading and downloading files between computers. FTP works on a client/server model. The server component is called an FTP daemon. It continuously listens for FTP requests from remote clients. When a request is received, it manages the login and sets up the connection. For the duration of the session it executes any of commands sent by the FTP client.

Note: Please set your server VM to “NAT Mode” to download from the Internet. Do this by editing /etc/networking/interfaces to enable DHCP from VMware. Switch back to static IP when done.

Some links to get you started:

https://help.ubuntu.com/10.10/serverguide/C/ftp-server.html

http://www.jonathanmoeller.com/screed/?p=2127

OpenSSH

ServerOpenSSH is a freely available version of the Secure Shell (SSH) protocol family of tools for remotely controlling a computer or transferring files between computers. Traditional tools used to accomplish these functions, such as telnet or rcp, are insecure and transmit the user’s password in cleartext when used. OpenSSH provides a server daemon and client tools to facilitate secure, encrypted remote control and file transfer operations, effectively replacing the legacy tools.

Note: Please set your server VM to “NAT Mode” to download from the Internet. Do this by editing /etc/networking/interfaces to enable DHCP from VMware. Switch back to static IP when done.

Some links to get you started:

https://help.ubuntu.com/10.10/serverguide/C/openssh-server.html

http://www.jonathanmoeller.com/screed/?p=2097

http://www.chiark.greenend.org.uk/~sgtatham/putty/

Advertisements

From → Labs

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: