How to configure DHCP Server in Ubuntu Linux 18.04 ( Complete Server & client )
HTML-код
- Опубликовано: 11 сен 2024
- How to configure DHCP Server in Centos 7 , Redhat 7 , Fedora ( Complete Server & client )
• How to configure DHCP ...
###############################################
What is DHCP Server ?
Dynamic Host Configuration Protocol (DHCP) is a network protocol that is used to enable host computers to be automatically assigned IP addresses and related network configurations from a server.
The IP address assigned by a DHCP server to DHCP client is on a “lease”, the lease time normally varies depending on how long a client computer is likely to require the connection or DHCP configuration.
How Does DHCP Work?
The following is a quick description of how DHCP actually works:
Once a client (that is configured to use DHCP) and connected to a network boots up, it sends a DHCPDISCOVER packet to the DHCP server.
When the DHCP server receives the DHCPDISCOVER request packet, it replies with a DHCPOFFER packet.
Then the client gets the DHCPOFFER packet, and it sends a DHCPREQUEST packet to the server showing it is ready to receive the network configuration information provided in the DHCPOFFER packet.
Finally, after the DHCP server receives the DHCPREQUEST packet from the client, it sends the DHCPACK packet showing that the client is now permitted to use the IP address assigned to it.
In this article, we will show you how to setup a DHCP server in Ubuntu/Debian Linux, and we will run all the commands with the sudo command to gain root user privileges.
Testing Environment Setup
We are going to use following testing environment for this setup.
DHCP Server - Ubuntu 18.04
DHCP Clients - Ubuntu 18.04 and Windows 10
source - www.techmint,com
#############################
follow us on facebook :-
/ androidandtechsolutions
Website Link :-
www.letslearnte...
Hey dude you are awesome! Simple explanation and great video, you made the configuration very understandable 👌🏻👌🏻✌ thanks :D
Modul 123 carry
Gracias buen señor. Me has salvado la vida. Te debo una. Me congratula que haya tan buen trabajadores como usted. Con amor desde ASIR (Antártida). Adiós... :)
This video definitely deserves more views. Keep up the good work !!
Thanks :)
I have a question. Can the DHCP server in my Ubuntu VM assign IP to my windows10 host? (I'm using Host-only-Adapter). I followed the steps in your video but the adapter keeps getting 169.254.xx.xx as its IP address.
Yes but for that you need to configure it to a network interface connected to you host machine..
In the video I have used bridge network to connect my vm to base machine...
I hope this helps you :)
Thank you for your excellent step-by-step instruction! I was able to follow along and found the part I had missed while setting up my client. It works!
exam tomorrow, thank you
Thanks dude, you helped me for my homework ! :D
Nice one again brother. You are doing great work man.
Thanks bro
That is insanely useful tutorial.
Your head was in front of the last server command you spoke about
:0)
what was the command?
love the way you describe.
thanks a lot
respects broski
I love you my indian man, you are better than teacher
Dude you are an actual life saver! Thanks👍
Well explained. Appreciate your efforts and knowledge sharing mind :-)
Thank you :)
Would you ever consider doing a tutorial of setting up an Ubuntu PXE server to do an unattended installation?
Hi very nice video about the setup. Great help :-)
Hi :D !!!! Very Good!! thank you so much man!!!
Hi I followed video right to end all was working except for end assigning fixed address to windows client
Windows client was just windows 11
Also it's lease only lasts for short time before having to forget and reconnect to wifi on windows client
u are life saver brother ❤️
Nice work, thanks for the video.
very nice explanation Thank you
thanks man much appreciate it you are awesome
Very nice video indeed but would have been more comprehensive if dhcp option tag configuration covered as well.
Jaja second 0:08 the automated captions saying "Hello friends you're watching erotic solutions" jajaja, die laughin'.
Excellent video, I was able to set this up ez
thank you bro! that helped a looooot.
Nice guide, I will try this. But is it not a bit odd to set the GW to .255? Is that not reserved for broadcasts?
One more strange thing is that both the broadcast and gateway addresses are same. Time - 6:47 . But, it wouldn't matter much as the whole setup is being routed through a virtual switch and is being emulated in a virtual machine/environment. In real world, where you'd use the connected machines for real-life tasks, it'd be a problem. But, again... When you are the DHCP, you become the gateway. Hence, going with localhost address should be fine, unless you have a separate gateway server configured on your network.
How you are add another window for Ubuntu and windows on same user
1 thing, in your video you use /etc/network/interfaces, but in 18.04 this file is replaced by /etc/netplan/50-cloud-init.yaml right?
No
@@AndroidandTechSolutions I read something about that making a new method to set a static ip for instance
That is server-side to configure static ip or dhcp on the interfaces
What keys we have to use for write and quit
Thank you, one of the best video on DHCP installation and configuration. By the way when i run dhcp-lease-list command it is not showing the lease list. Instead it is saying cannot open /car/db/dhcpd.lease. Any helpful tips to get this sorted out?
You'd have found the answer long back. But, I am still answering because it may help others. This is because the DHCPd service is trying to read the lease list from "/car/db/dhcpd.lease"(in your case). But, the actual lease list resides in "/var/lib/dhcp/dhcpd.leases". 15:33 - Check your /etc/dhcp/dhcpd.conf file and change the location pointer/directory where it is reading the lease list from... A good start is to look the error message and replace that directory path with the above one.
super filmik pozdrawiam z polski :DD
If I use a client on another computer, Is there something that I have to pay attention on?
Or everything is the same?
By the way, Great video!!! And thanks for the quick answers
Yes you have to make sur that the client is in network
Should the DHCP server must have a static ip address? before setting the configuration? If no, why?
correct me if i am wrong.. i was thinking gateway address should be placed in option router, instead you provided broadcast addr. what if you provide inet addr found from ifconfig?
Hello , Can we configure any Wifi Router (Link Sys) to get IPs for users from Linux machine dhcp server instead of using pool inside Router. ??
Amazing!
Thanks
Just wondering about the last part of enabling the dhcp, I dont know if this is right "sudo ufw allow in on enp0s3 from any port 68 to any port 67 UDP" can you write down here what's exactly you did cause your camera blocked it so I wasn't sure about that part. ty
when I entered the restart command in client-side -- the output was failed to restart networking.service: unit networking.service not found and my and enp0s3 output is mtu 1500 qdisc noop state down group default ubuntu. how can I resolve it?
This /etc/netwok/interfaces file does not exist on ubuntu 20.04. Please how do i go about it?
SUPER OCHOOOO POMOGŁO W RZYCIU, ZNALAZŁEM 1000000000000 DOLARÓŒ PO TYM WIDEO , PIĘKNĘ WIDEO !!!!!!!!!!!!!!
When you write the conmond
Sudo nano /etc/default/isc-dhcp-servrr
Then ens3 k bad apny kia type kia ya kia press kia jis k bad next page aya...mera next page empty ata hy ....kindly guide m kal mera exam hy
I want to get DHCP server for my cisco gear lab but do I really need DHCP client windows on any of my network topologies ?
good job man, can you upload how to install and configure snort on ybuntu server please?
Drinking game:
take a shot every time he says "okey"
Sir, how are you writing and Quitting ? Ctrl+O to write and ?
For write-Press F3
For close the window-press F2
Hi there, I have a question,
Let's assume we have 10 scopes for our IT infrastructure, in the infra we have 2 buildings and each building hase its own scopes.
say we have 1st scope is IT in building A, and 5th Scope is IT in building B. now I want to make a reservation for one IT user in both fisrt scope and fifth scope.
Can Ubuntu DHCP Server be able to do that ? Or, do you know some solutions to this ?
thank you in advance.
Hello, i have a ubuntu 14, it was configured by someone else a few years i know that it works because it assigns ip's from network 10.X.X.X to the devices but if i check with command dhcp-lease-list it doesnt show any ip assigned, neither if i look in the dhcpd.conf the pool 10.x.x.x doesnt exist, where should i look?, regards
Hi bro, i have done the same as you do but in dhcp-lease-list i cannot see my client ip address. can you help me with that?
what a video
whats the client side and how did you configure it?
i had configured the dhcp server at the host side completley and its working but but at the client side my clients are not getting connected withe the host am not getting the dhcp servers ip at client side it is still displaying the its old ip address.
the first adaptator is connected on NAT or inner network?
why is your subnet ending on .0 if your inet is ending on .10?
Can you show it with ubuntu, instead of windows
How did you get the different clients
what is the setting of VM Network Adaptor?
can I connect to this server to GNS3..?
Sir I've trying to manage client machine frm server and install softwares and drivers from server..
How I do plz help..🙏
Does the client have to be a virtual machine? Will it work also with my phone or another laptop?
It is not necessary that client must be another virtual machine it can be other computer also.. :)
hi, i am working on aproject were i need to use ubuntu 16.04.5 GUI as ltsp server to use with thin client pc. but till now i am not successful. need a few suggestion
thanks a lot for the video .. but client cannot access internet . is there something else to be done ?
Hassin Ayaz
Set gate way of the ip which is able to access Internet.
Hi there Thanks for this, however how can i add a failover router so that if the first router inter fails it will change the dhcp to allow all users to connect to the second router?
I am not sure but yes..
I will research on this and will let you know
This isn't a router configuration. This is a DHCP server. You can add failover DHCP servers to the router config. But, not the other way around. If you are asking - what if the switch fails, and you need redundancy... Add one more NIC to your machine and add another switch and configure it to be the failover interface in the dhcpd configuration file. But, this is unnecessary redundancy. I feel that I answered your question in the first part... You can add additional/optional DHCP servers to the routers, because they route traffic, you cannot add additional routers to the DHCP server... DHCP server's job is to hand out DHCP IP addresses...
My brother at 2:43 may I ask what was it you input to exit I tried typing "^X" as reads but didnt work could you please give us a hint on the matter (Sorry am a bit of a newbie to linux terminal
Ctrl + X
Never mind i got it slowly learning
No problem bro subscribe my channel you will learn a lot
How to configure dhcp server for multiple vlan subnet or multiscope ???
bro can u help if i type commad ifconfig ensp7s0 doesnt show his inet and subnetmask,should i setting with myself with command(sudo ifconfig ensp7s0 192.168......)
oke? big man
Do you know how can i set the dhcp authentication?
I did all the things as shown in video. Client is not getting ip. May i know the network configuration like which network card is being used n all.
When we go to ifconfig we can see 1 port n 1 loopback. Is that NAT or Bridge???
i have question in minutes 2:41, after typing "ens" what can i do?
thanks.. i'm newbie, want to learn server.. (ctrl+s and ctrl+z) or any?
thanks master..
Uh i had trouble myself in case you hadnt figured it out yet its ctrl+x
as in hold control x
your welcome
Sorry typing error it should be /var/db/dhcpd.leases
Ok will have a look
What's that part after giving the interface name "write and quit"...I didn't get it
It means saving the file
It's not getting configured.....after checking the status it's showing
Active : failed
I checked but configurations are correct
07:22
Sir I sees that some time after my public ip is changed ?? so how can connect with domain
You need static IP then
Make a notepad with commands to be easier for viewers follow your video
what network adapter you use in both of your client?
eth0
@@AndroidandTechSolutions no i mean are you using host-only, nat or anything else?
Nat
ddin't work
Sir I want to host jsp website from my computer ubuntu Os and install tomcat so I want to know Static Ip must be buy or normal Internate connection by router is enough for it?? Domain name need to buy must or just any name we can do just like royinfotech.com?? can you help me??
Hi,
Yes you need to buy domain and you need to point that domain to your public ip which is trough your router..
In your router you need do port forwarding to make your server live on the internet.
Hope this helps..
Thanks!!
Sir I want to buy domain after I can connect my PC as linux tomcat webserver so how can do it?? again I need to buy static Ip ??
DHCP server running but the ip address on windows not within range
Lease list is empty
Stop dhcp then start
is it fine if both client & server has the same ip address?
Ubuntu server inet : 10.0.2.15
Windows ip address: 10.0.2.15
Since both are attached to NAT on virtualBox
No like that your dhcp will not work
What should i do to resolve then? Im using virtualBox
@@yeohfuseong Bridget net instead of NAT
Instead of installing the net-tools package just for "ifconfig" simply do "ip addr" ... welcome to GNU/Linux
command 8:49 please
Only windows gets listen in lease list, not the ubuntu client
Bro watch again
Ok I shut down my windows machine and now the Ubuntu client is showing
why does only 1 client work at a time?
@@AndroidandTechSolutions I did and I followed your instructions religiously.
Only 1 of 2 clients shows up at any time. If windows client is shut down, then ubuntu shows up. If not, only windows shows up
on 7:39 sec how you have started writing again
Press i to start writing
To save and quite press esc
:wq
can client access internet ??
Yes
client can get ip address from dhcp but it can't access internet. can you please help ?
Look for that you have to set gate way from which the Internet is coming
can you config proxy server for client can't access some website such as: facebook or google
Yes wil upload a video regarding it in a few days it is done through squid server
1:42 first i installed netdudes xd
but he probably means
apt install net-tools
That's what he said.. net-tools
Plzzz repaly m as soon as possibke
okay
ok
666
How did you get the different clients
I have a virtual machine in that I have setup SSH
@@AndroidandTechSolutions Thanks very much
Awesome tutorial
Thanks Mate
ok
Ok ;)