Rabu, 01 Agustus 2012


Install DHCP on Ubuntu SeDHCP & ubuntu server

How To Install DHCP Server on Ubuntu

Previously here assumed that the dhcp server to be made: 
* Using the eth0 interface 
its IP Addres * Range: 192.168.0.100 to 192.168.0.200 
* Subnet Mask: 255.255.255.0 
* DNS Servers: 202.188.0.133, 202.188.1.5 
* Domains: tm. net.my 
* Gateway Address: 192.168.0.1 

OK, now we start immediately wrote! 
Bismillahirahmanirrahim, 
* First install dhcp3-server first via Synaptic or via command prompt by: 
sudo apt-get install dhcp3-server 
* Then we will make changes to the file using gedit, but before the first backup to first edit the original file so that when damaged can be restored to the default 
sudo cp / etc/default/dhcp3-server / etc/default/dhcp3-server_backup 
gksudo gedit / etc / default/dhcp3-server 

* Then find the line below: 
INTERFACES = "" 
then replace the line above a row are like below: 
INTERFACES = "eth0" 
* Save the file 
* Next we will make changes to the configuration file, but before just as in the first backup file 
sudo cp / etc/dhcp3/dhcpd.conf / etc/dhcp3/dhcpd.conf_backup 
gksudo gedit / etc/dhcp3/dhcpd.conf 

* Find the line - the line below 
# option definitions common to all supported networks ... 
option domain-name "example.org"; 
option domain-name-servers ns1.example.org, ns2.example.org; 

default-lease-time 600; 
max-lease-time 7200; 

then replace the lines in on a line are like below: 
# option definitions common to all supported networks ... 
# option domain-name "example.org"; 
# option domain-name-servers ns1.example.org, ns2.example.org; 

# default- lease-time 600; 
# max-lease-time 7200; 

* Find another line below: 
# A slightly different configuration for an internal subnet. 
# subnet 10.5.5.0 netmask 255 255 255 224 { 
# range 10.5.5.26 10.5.5.30; 
# option domain-name-servers ns1.internal.example.org; 
# option domain-name "internal.example.org"; 
# option routers 10.5.5.1; 
# option broadcast-address 10.5.5.31; 
# default-lease-time 600; 
# max-lease-time 7200; 
#} 

and replace the line above a row are like below: 
# A slightly different configuration for an internal subnet. 
subnet 192.168.0.0 netmask 255.255.255.0 { 
range 192.168.0.100 192.168.0.200 ; 
option domain-name-servers 202.188.0.133, 202.188.1.5; 
option domain-name "tm.net.my"; 
option routers 192.168.0.1; 
option broadcast-address 192.168.0.255; 
default-lease-time 600; 
max- lease-time 7200; 

* Save the edited file is! 
* Now restart the dhcp server by typing the following command: 
sudo / etc/init.d/dhcp3-server restart 
After we managed to do all of the above then we have completed create a DHCP Server on Ubuntu Feisty.Because this paper is to use your version of Feisty then please adjust if menggukan latest version of ubuntu.

Static IP steps in Ubuntu Server

Hellow friends, this time I will divide up the material from which the material results of studying my Ubuntu Server 10:10 . 10:10 Ubuntu Server in order to connect to the network, either local network or the Internet, the initial step is to do konfigrasi IP address. To configure the IP address of the steps are as follows:
  • Enter the username and password that is set in the previous step.In this article I use is userame  Berliana and my password also Berliana For the password will not be visible when typed for security reasons. Press Enter when you are sure to enter your username and password correctly.
  • After a successful entry will be shown when users last logged adamkurniawan. In the bottom row looks posts Berliana @ Server01: ~ $ , this means users with ids adamkurniawan still existed as a regular user and have not been able to make arrangements. In order to do the settings, the user must be logged in as root mode or ultimate mode in the system (administrator) by typing sudo su , then it will be the note [sudo] password for Berlana: it means the system prompts for a password that the user can enter the id adamkurniawan root mode. Password is used for root mode is the same password used to login at the beginning.Enter the password and press Enter . If the password is entered correctly, it will appear the words root @ Server01 :/ home / Berliana # , this means users with ids adamkurniawan already entered as root mode and are able to do the configuration.
  • Before configuring the IP address, check in advance what the name of the network card (ethernet) are available that can be used by typing: # ifconfig-a | more . Naming the network card on a Linux system begins with followed by eth network card number starting with 0, eg eth0, eth1, eth2, and so on. Because in this article, I use two network cards then after you type # ifonfig-a | more , it was found that the name of the network card I have on linux system known as eth0 and eth1.
  • type the command # nano / etc / network / interfaces to start configuring the IP address of the Ubuntu Server 10.10. At the end of the line type the following script: auto eth0 iface eth0 inet static 
    address 192.168.6.200 
    netmask 255.255.255.0 
    gateway 192.168.6.254
    the above script is a script that is used to set the first network card (eth0) to be connected to the internet. IP address should I give a segment to the existing network on the Ubuntu Server 10:10 that I use and the first gateway of the network card must also be an IP address of the device that acts as a gate of the Ubuntu Server 10:10 I use the internet. As for the second network card settings to be used as an interface to the local network are as follows:
    auto eth1 
    iface eth1 inet static 
    address 10.10.1.254 
    netmask 255.255.255.0
    When you have finished press the 
    Ctrl + O to save the configuration that has been done, give the name of the configuration file you just created, in this article I do not give a new name, so I immediately Just press the Enter key . Later press Ctrl + X to exit. Restart the network card using the command # / etc / init.d / networking restart so the new configuration can be made ​​readable by the system.
  • In general, if the network card has not been configured to use Ubuntu Server Ubuntu Server 10:10 or 10:10 is still used a newly installed (fresh install), a network card that is embedded in a computer has been read but not yet active. To see if the network card is active or not, type the command # ifconfig . In this article, I use a network card is not yet active.
  • To activate it type the command # ifconfig eth0 up (enable the first network card) and # ifconfig eth1 up (turn on a second network card). After that make use of the network card restart # / etc / init.d / networking restart . If it be checked again using the command # ifconfig , it will be seen that the network card is active and already has an IP address corresponding to that already in the configuration.
  • The next step is to provide DNS (Domain Name System). DNS is used as an interpreter of the domain names to IP addresses, and vice versa, ie from IP addresses into domain names. So when users type in google.com in the web browser, then that means the user dials the IP address of google.com is 74.125.71.103. To set the DNS in Ubuntu Server 10:10 user must create a new file calledresolv.conf which is placed in the directory / etc by typing # touch / etc / resolv.conf, but before the user must enter the root mode.Having successfully made, the next is filling the file resolve.confwith IP addresses that can translate domain names into IP addresses and vice versa, by typing the command # nano / etc / resolv.conf . Then type the nameserver and followed by the IP address that can be used as a control, in this article I use 2 pieces of DNS, which is 192.168.4.254 which is the gateway IP address of the Ubuntu Server 10.10 and 8.8.8.8 which is the address of the DNS provider is made ​​by Google. So the writing is as follows:nameserver 192.168.4.254 nameserver 8.8.8.8 

    Save by pressing 
    Ctrl + O , press the Enter key to replace the old name and press Ctrl + X to exit. Do it again to restart the network by typing # / etc / init.d / networking .
  • The next stage is to check whether Ubuntu Server 10:10've been able to connect to the internet and if DNS is working properly. How to do it is to do a ping to a domain address. In this article, I did a check by pinging yahoo.com domain. Typed command is # ping yahoo.com . here I have received a reply from yahoo.com and 10:10 which means that Ubuntu Server is used as the server is properly connected to the internet, as well as its DNS.
  • Next, do the configuration for all clients who are on the local network can access to the network that are outside the network (internet) or do NAT. If not configured then the packets originating from the local network card (eth1) will not be forwarded to the network card that leads to the internet (eth0). The trick is to type the following command: iptables-t nat-A POSTROUTING-o eth0-j MASQUERADE and then press Enter . If you want this rule to run when the computer is turned on, then the above rule then type in the file / etc / rc.local before the line exit 0.

Tidak ada komentar:

Posting Komentar