Jump to content

How to set up DHCP on ubuntu server and connect it to the second computer?

I set up static DHCP on ubuntu server, on regular ubuntu I entered the gateway address, which is 10.10.10.1.

The IP address of the regular ubuntu is 10.10.10.2 and the ubuntu server is 10.10.10.1 so they are on the same network. But ping doesn't work.

 

Why do some people write enp0s3 and enp0s8 in this file and others write eth0i eth1 instead?

 

The same with the IP address, some people write [10.10.10.1/32] and others write in the same place - 10.10.10./32?

 

I heard that it was done like this once. But I don't know which way is correct.

1.png

Link to comment
Share on other sites

Link to post
Share on other sites

Why are you doing this?

Why not connect both to your router and let that handle DHCP

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, whispous said:

Why are you doing this?

Why not connect both to your router and let that handle DHCP

For DHCP to be a router and for both computers to communicate through it?

 

But at school, I have such a task. You need to do so that DHCP is on the ubuntu server.

 

You know how to do it?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, GamerGry123 said:

For DHCP to be a router and for both computers to communicate through it?

 

But at school, I have such a task. You need to do so that DHCP is on the ubuntu server.

 

You know how to do it?

Are you asking us to do your homework?

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, whispous said:

Are you asking us to do your homework?

I'm not asking for homework.

 

What I knew was what I did in this task.
I don't know how to setup EIGRP between two routers.

Link to comment
Share on other sites

Link to post
Share on other sites

Are you running a DHCP server on your Ubuntu machine? Just giving it a static address won't set up dhcpd.

 

https://ubuntu.com/server/docs/network-dhcp

 

43 minutes ago, GamerGry123 said:

For DHCP to be a router and for both computers to communicate through it?

DHCP is not a router. That's a separate function you have to configure. DHCP just hands out IP addresses so your devices don't have to fall back to APIPA addresses. (The 169.254/16 block)

 

https://help.ubuntu.com/community/Router

 

That will let you ping the outside world, but you will still have to set up a local DNS separately (or specify an outside DNS) in order for host names to work.

I sold my soul for ProSupport.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Needfuldoer said:

Are you running a DHCP server on your Ubuntu machine? Just giving it a static address won't set up dhcpd.

 

https://ubuntu.com/server/docs/network-dhcp

 

DHCP is not a router. That's a separate function you have to configure. DHCP just hands out IP addresses so your devices don't have to fall back to APIPA addresses. (The 169.254/16 block)

 

https://help.ubuntu.com/community/Router

 

That will let you ping the outside world, but you will still have to set up a local DNS separately (or specify an outside DNS) in order for host names to work.

So, I didn't have the DHCP service installed. But when installed, it doesn't work either.

 

Why is this done weird. That each word that is from a new line must be under a letter of a different word. Who came up with it like that?

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, GamerGry123 said:

I set up static DHCP on ubuntu server, on regular ubuntu I entered the gateway address, which is 10.10.10.1.

The IP address of the regular ubuntu is 10.10.10.2 and the ubuntu server is 10.10.10.1 so they are on the same network. But ping doesn't work.

 

Why do some people write enp0s3 and enp0s8 in this file and others write eth0i eth1 instead?

 

The same with the IP address, some people write [10.10.10.1/32] and others write in the same place - 10.10.10./32?

 

I heard that it was done like this once. But I don't know which way is correct.

enp0s3, enp0s8, eth0, and eth1 are different names for the different network adapters on a PC. You have to use the one that corresponds to the network port you want to use.

 

The number after the slash refers to the number of bits in the subnet mask. "10.10.10.1/24" refers to a given host (in this case, 10.10.10.1 with a netmask of 255.255.255.0), "10.10.10./24" refers to the whole subnet (10.10.10.1-254 with netmask 255.255.255.0).

 

You should have gone over all of this in class, if they expect you to be able to set it up on your own as an assignment...

 

1 hour ago, GamerGry123 said:

So, I didn't have the DHCP service installed. But when installed, it doesn't work either.

How do you have it set up? What's in your config file? Is dhcpd pointed at the correct NIC? What's the output of 'ifconfig' on your server?

 

How do you have these PCs physically connected to each other?

 

If you set them up with two static addresses like this, can they ping each other?

 

	Server		Client
Address	10.10.10.1	10.10.10.2
Mask	255.255.255.0	255.255.255.0
Gateway	10.10.10.1	10.10.10.1

 

1 hour ago, GamerGry123 said:

Why is this done weird. That each word that is from a new line must be under a letter of a different word. Who came up with it like that?

What?

I sold my soul for ProSupport.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Needfuldoer said:

enp0s3, enp0s8, eth0, and eth1 are different names for the different network adapters on a PC. You have to use the one that corresponds to the network port you want to use.

 

The number after the slash refers to the number of bits in the subnet mask. "10.10.10.1/24" refers to a given host (in this case, 10.10.10.1 with a netmask of 255.255.255.0), "10.10.10./24" refers to the whole subnet (10.10.10.1-254 with netmask 255.255.255.0).

 

You should have gone over all of this in class, if they expect you to be able to set it up on your own as an assignment...

 

How do you have it set up? What's in your config file? Is dhcpd pointed at the correct NIC? What's the output of 'ifconfig' on your server?

 

How do you have these PCs physically connected to each other?

 

If you set them up with two static addresses like this, can they ping each other?

 

	Server		Client
Address	10.10.10.1	10.10.10.2
Mask	255.255.255.0	255.255.255.0
Gateway	10.10.10.1	10.10.10.1

 

What?

If the addresses are the same, they will not be pinged.

This is done on virtualbox.

 

We did it at school. But the teacher did not explain why we write the address in this way: [10.10.10.1/24] and on the Internet, if you see, all write like this: - 10.10.10.1/24

 

It does not explain what the gateway address is, it only enters it and we have to repeat the same.

 

I know what a gateway address is and what it is for.

 

But when we enter the gateway address on networks, several people know why we enter such an address and that it is the address of the router.

 

Anyway, I can see that there is very little information on the internet about the web. A lot of information is that there were many years ago. You can see this as you enter the eigrp configuration in the cisco packet tracker and see the movies in the tab and see what the quality of these movies is.

 

When it comes to programming, there are thousands of movies about the same in good quality and there are still new movies being made about it.

 

Do you agree that it is so?

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, GamerGry123 said:

If the addresses are the same, they will not be pinged.

This is done on virtualbox.

Yes, the addresses have to be different. That's why I said to make the server .1 and the client .2. The netmask and default gateway should be the same for every device on the subnet.

 

How do you have the virtual networking configured in VirtualBox? NAT? Bridged? Your VMs might not be able to see each other, even if everything inside them is set up properly.

https://www.virtualbox.org/manual/ch06.html

 

1 hour ago, GamerGry123 said:

We did it at school. But the teacher did not explain why we write the address in this way: [10.10.10.1/24] and on the Internet, if you see, all write like this: - 10.10.10.1/24

Like I said, the /24 means that network or device has a 24 bit subnet mask. "10.10.10.1/24" means the IP address is 10.10.10.1 and the subnet mask is 255.255.255.0.

 

1 hour ago, GamerGry123 said:

Anyway, I can see that there is very little information on the internet about the web. A lot of information is that there were many years ago. You can see this as you enter the eigrp configuration in the cisco packet tracker and see the movies in the tab and see what the quality of these movies is.

 

When it comes to programming, there are thousands of movies about the same in good quality and there are still new movies being made about it.

 

Do you agree that it is so?

There's mountains of information about it! TCP/IP is old. IPv4 has not substantially changed in over 20 years. Just about anything you can find about it will still be relevant.

 

https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html

 

I highly recommend looking for an IPv4 subnetting tutorial, it sounds like the teacher didn't show you how it works, only "do this and it will work", which isn't very helpful.

I sold my soul for ProSupport.

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, Needfuldoer said:

Yes, the addresses have to be different. That's why I said to make the server .1 and the client .2. The netmask and default gateway should be the same for every device on the subnet.

 

How do you have the virtual networking configured in VirtualBox? NAT? Bridged? Your VMs might not be able to see each other, even if everything inside them is set up properly.

https://www.virtualbox.org/manual/ch06.html

 

Like I said, the /24 means that network or device has a 24 bit subnet mask. "10.10.10.1/24" means the IP address is 10.10.10.1 and the subnet mask is 255.255.255.0.

 

There's mountains of information about it! TCP/IP is old. IPv4 has not substantially changed in over 20 years. Just about anything you can find about it will still be relevant.

 

https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html

 

I highly recommend looking for an IPv4 subnetting tutorial, it sounds like the teacher didn't show you how it works, only "do this and it will work", which isn't very helpful.

I know how addressing works and how to address computers.

See if I have correctly set up network cards in vitualbox?

 

1 This is the server's network card that allows you to access the Internet.

2 The same is the server's network card that does not have access to the Internet, but it is there to connect to the computer that is connected to the server.

On the internet, they set the name of the second network card of the intnet server. It has to be that name?

That's how it works?

Is it well positioned?

 

Then I set up these IP addresses on the server.

enp0s3 it is 1 network card and the DHCP service is enabled on it, which itself assigned it an IP address mask and gateway address. Yes?

 

enp0s8 this is the 2nd NIC where the address 10.10.10.1 is set and you have 255.255.255.0 the address of this NIC is the gateway address for the computer that is connected to this server.

 

On the computer connected to this server I entered the address 10.10.10.2 and the same address as on the server. the server and the computer are on the same network.

 

Ping is not working. I do not know why.

 

I did this without installing the DHCP service.
The DHCP service is installed with the command: sudo apt install isc-dhcp-server
I did not enter this command.

 

I sent photos. See if everything is well done.

 

 

 

1.png

2.png

3.png

4.png

Link to comment
Share on other sites

Link to post
Share on other sites

Okay, I think I see what you’re doing now. 
 

The server VM needs two NICs: one that can talk to the outside world, and one ‘internal’ network. 
 

The client VM only needs one NIC with internal networking. 

 

The two VMs should then be able to talk to each other over the ‘internal’ NICs, and the server VM does routing to get ‘internal’ traffic out to your physical LAN and beyond to the Internet. 

 

I sold my soul for ProSupport.

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, Needfuldoer said:

Okay, I think I see what you’re doing now. 
 

The server VM needs two NICs: one that can talk to the outside world, and one ‘internal’ network. 
 

The client VM only needs one NIC with internal networking. 

 

The two VMs should then be able to talk to each other over the ‘internal’ NICs, and the server VM does routing to get ‘internal’ traffic out to your physical LAN and beyond to the Internet. 

 

Yes, I know the server must have two network cards and so I have virtualbox set.
See if it's okay.

I know ubuntu only needs one master card and so it is set to virtualbox.

Then I entered the gateway address and the server's internal network card mask on ubuntu.

 

I showed you all the photos, where and where, what I had set.

You know why it doesn't work?

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, GamerGry123 said:

Yes, I know the server must have two network cards and so I have virtualbox set.
See if it's okay.

I know ubuntu only needs one master card and so it is set to virtualbox.

Then I entered the gateway address and the server's internal network card mask on ubuntu.

 

I showed you all the photos, where and where, what I had set.

You know why it doesn't work?

Works, the ubuntu NIC name had to be the same as the server's internal network card name.

But how does it work that there is a ping connection between the server and the computer, but there is no DHCP installed on the server?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×