DHCP Server, FTP Server on Debian 7.8 Linux Server

in #technology7 years ago

  1. What is DHCP Server?

  2. Image credits : https://www.cisco.com

    DHCP (Dynamic Configuration Protocol) server is a service that automatically assigns IP addresses to the computer that requests it. A computer that assigns an IP address is called a DHCP server, while a computer that requests an IP address is called a DHCP Client. Thus administrators no longer have to provide IP addresses manually during TCP / IP configuration, but simply by giving a reference to the DHCP Server.

    When both DHCP clients are turned on, the computer makes a request to the DHCP-Server to obtain the IP address. DHCP responds by providing an IP address in the DHCP database. DHCP Server after providing the IP address, then the server leases the existing IP address to DHCP-Client and deletes it from the pool list. The IP address is assigned along with the subnet mask and default gateway. If no more IP address can be assigned, then the client can not initialize TCP / IP, by itself can not connect to the network.

    After a certain period of time, then the use of DHCP Client is declared completed and the client does not renew the request again, then the IP address is returned to the DHCP Server, and the server can provide the IP address to the Client in need. The length of this period can be determined in minutes, hours, months or forever. The term is called a leased period.

    Let's start to configuring DHCP service on our create Server of Debian 7.8 Linux.

    • First, Install DHCP Server software
      # apt-get install isc-dhcp-server
      Please wait until installation completed. At the process there is message
      "[FAIL] Starting ISC DHCP Server ... [Failed]"
      Don't worry this is normal, because DHCP Service did't configured.

    • Let's start to configure DHCP Service.
      Point to line number 50, under comment
      # A slightly different configuration for an internal subnet.
      Remove all tags (#) under above comment up to 9th line.

      Then change the values in this section with the following conditions.
      Subnet is subnetwork address, not IP Address. Depending to what CIDR of network used.
      Range is IP to lease range the first left one is start IP to lease and the second is end of IP to lease.
      Netmask is Network masking, netmask is an important part in an address, in the calculation of subnetting netmask is a solution to determine subnet, broadcast, and valid IP.
      Option domain-name-servers is created domain name at DNS configuration.
      Option domain -name is option value for DNS Server.
      Option routers is Router IP or Default Gateway IP address, in this case it was Server IP Address.
      Option Broadcast-address is broadcast address of our network.
      Default-lease-time and Max-lease-time is time of IP address to lease to client request in second.
      DON'T FORGET TO SAVE CHANGES!

    • If any changes was completed and saved, now restart DHCP Service.
      # service isc-dhcp-server restart
      When DHCP service restarted there is Failed on stop service and it's OK at starting service.

    • Okey, New connect any client to server ethernet. I am using VMWare adapter to trying DHCP at client. Please follow all steps.
      1. Right click at VMWare Network Adapter VMNet1 and click on Status

      2. Click on Properties

      3. Point to Internet Protocol Version 4 IPV4 and click Prpperties.

      4. Click on [Option]Obtain an IP address automatically and also DNS Server then click OK to confirm.

      5. Click Close to exit.

      6. Click on Details ... to see DHCP Client IP address if it is success.

      7. Now we can see IP address of client it's got from server DHCP service.
        DHCP Enabled [Yes] it's mean there is no Manual IP of client configured.
        IPV4 Address is the first IP of DHCP Server to lease.
        And other is Following to Server of DHCP configured.

    • FTP Server - FTP Client

    • Image credits : https://www.deskshare.com

      FTP is File Transfer Protocol (FTP) functions to exchange files in a network that uses TCP connections instead of UDP. Two important things in FTP are FTP Server and FTP Client.
      FTP server is software running to provide file exchange services where the server is always ready to provide FTP service if it gets a request (request) from the FTP client.
      FTP client is software that perform connection request to FTP server for the purpose of exchange file. Once connected with the FTP server, the client can download, upload, rename, delete, etc. in accordance with the permissions provided by the FTP server.

      At this post I am not using ProFTPD applications, but I am using VSFTPD for more secure and more easy.

      Les's start to configure VSFTPD with TLS

      • Install VSTPD application.
        # apt-get install vsftpd
        Please wait until installation completed.

      • Configure vsftp # nano /etc/vsftpd.conf
        Un-comment these lines
        local_enable=YES
        write_enable=YES
        local_umask=022

      • Then go to the last line and add the codes :
        ssl_enable=YES
        allow_anon_ssl=YES
        ssl_tlsv1=YES
        ssl_sslv2=NO
        ssl_sslv3=NO
        require_ssl_reuse=NO
        ssl_ciphers=HIGH

      • We must create an SSL certificate.
        I create it in /etc/ssl/private - if the directory doesn't exist, create it now.
        # mkdir -p /etc/ssl/private
        # chmod 700 /etc/ssl/private

        Then generate the SSL certificate as follows:
        # openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout /etc/ssl/private/vsftpd.pem -out /etc/ssl/private/vsftpd.pem
        Complete them
        • Country Name (2 letter code) [AU]: <-- Enter your Country Name (e.g., "ID").
        • State or Province Name (full name) [Some-State]:<-- Enter your State or Province Name.
        • Locality Name (eg, city) []:<-- Enter your City.
        • Organization Name (eg, company) [Internet Widgits Pty Ltd]:<-- Enter your Organization Name (e.g., the name of your company).
        • Organizational Unit Name (eg, section) []:<-- Enter your Organizational Unit Name (e.g. "IT Department").
        • Common Name (eg, YOUR name) []:<-- Enter the Fully Qualified Domain Name of the system (e.g. "server1.example.com").
        • Email Address []:<-- Enter your Email Address.

      • Now resatart vsftpd service
        # service vsftpd restart

      • I will create a user "user1" with the password "1234". All FTP users shall have their home directories in "/var/ftp_root", so I'll create this directory first. # mkdir /var/ftp_root
        Then add the user :
        # adduser --home /var/ftproot/user1 user1

      • Okey, anything running good, let's try to access FTP with TLS using Filezilla (click here) to download
        1. Open FileZilla application.
          Open File menu and click Site Manager

        2. Click New Site buton

        3. Just Follow my instruction on the picture, and click Connect button if finished.

        4. Enter created password to "user1", password is "1234". Click OK button or hit Enter.

        5. This is Certificate that we have created before, just click OK to continue.

        6. FTP Connection is successful.

        7. Trying to Upload Files or Folders from client.

        8. Files upload successful, now I sure FTP is running without problems.




      Read My Last Posts to Understand this Project. Thanks to read my posts.

      1. Installing Linux Debian 7.8 as Server
      2. Installing and Configuring DNS Server on Debian 7.8 Linux Server
      3. Installing and Configuring Web Server on Debian 7.8 Support by WordPress CMS
      4. Installing and Configuring Mail Server and Web Mail Server on Debian 7.8

      Next time I have some unique of SERVER Projects, My hope I have more time to complete it and share it to you.

      Best Regards @azizali

      IMG_5032 (2).JPG

Sort:  

Luar biasa. Tutorialnya sangat detail dan budah diikuti. Keep posting bro @azizali :)

Oh ya, gimana caranya agar bisa jadi author di @curie :D

it really helps me :)