Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
hummingbird hoedown
Sep 23, 2004


IS THAT A STUPID NEWBIE AVATAR? FUCK NO, YOU'RE GETTING A PENTAR

SKILCRAFT KREW Reppin' Quality Blind Made Products
Problem description:

My end goal is to have a server that can network boot a bunch of laptops and run a kiosk Linux distribution that directs to a locally hosted website.

Here's what I have:

1. Decent desktop (the server) with Ubunty 12.04 desktop installed and hosting the .iso image for the laptops to boot from
2. Old laptops (the clients) with enough power and memory to run Porteus Kiosk, the kiosk distribution I've decided on
3. 24 port switch to connect the server with the clients
4. Another computer that acts as the server to host the internal website

I have been able to successfully follow the Porteus Kiosk guide and get a laptop to boot over the network. In my case, we have no need or desire for anything to be connected to the public Internet. Ideally everything will run on this unconnected LAN.

My trouble begins with trying to get IP addresses for all of the nodes of this network. When I have things hooked up to my home network every node is getting a local IP address. When I remove the Internet connection the IP addresses go away even though I thought I was running a DHCP server. I'm using the dnsmasq program as suggested by Porteus Kiosk. I've messed with the config file for dnsmasq but can not seem to get it to start dishing out IP addresses to the nodes.

What might be wrong and is what I'm trying to accomplish possible in the first place, namely giving IP addresses to nodes on a network that aren't connected to the Internet?

Attempted fixes:

I've tried restarting network services as well as dnsmasq when the server is not connected to the Internet. When I do this the server and all clients connected by the switch lose their IP addresses.

Recent changes:

I haven't made any recent changes to anything. It's a fresh Ubuntu install and I added the dnsmasq and webfs packages to get the PXE booting to work.

--

Operating system: Ununtu 12.04 LTS 64-bit desktop edition

System specs: An older Dell desktop. The hardware appears to be running fine.

Location: US

I have Googled and read the FAQ: Yes

hummingbird hoedown fucked around with this message at 13:50 on Jul 3, 2016

Adbot
ADBOT LOVES YOU

Lobus
Jun 24, 2016

What happened here?
:parrot:
Sounds like maybe your home router is running the DHCP server, so when you brake that off of this little network you have setup nothing is handing out addresses.

DHCP3 ought to be able to do what you need: https://help.ubuntu.com/community/dhcp3-server if you want to run it on your ubuntu box. It will also let you set any dhcp options you may need for pxe booting.

telcoM
Mar 21, 2009
Fallen Rib
When you disconnect the external network, your server host cannot give itself an IP address through DHCP: that would be a bit of a Catch-22.

It might be easier to configure this if the server had two network interfaces: one for the internet connection and another for the local network that contains the clients. Then you could configure the first NIC to get its IP address with DHCP, and the other with a static private IP address and dnsmasq serving any clients through it.

If you have just one network interface, you'll need to have two configuration sets: one for when the server has internet connectivity and gets its own IP address with DHCP from the router, and another for when it's acting as a server for the clients. The latter configuration would include a static private IP address for the server's network interface.

hummingbird hoedown
Sep 23, 2004


IS THAT A STUPID NEWBIE AVATAR? FUCK NO, YOU'RE GETTING A PENTAR

SKILCRAFT KREW Reppin' Quality Blind Made Products

telcoM posted:

When you disconnect the external network, your server host cannot give itself an IP address through DHCP: that would be a bit of a Catch-22.

I can see how the server can't give itself an address through DHCP but it should be able to have a static IP address if it were running dnsmasq and not connected the the internet, correct?

telcoM
Mar 21, 2009
Fallen Rib

Hummer Driving human being posted:

I can see how the server can't give itself an address through DHCP but it should be able to have a static IP address if it were running dnsmasq and not connected the the internet, correct?

Sure it can, and I would almost say it _must_ have that.

The server needs to have a valid IP address configuration for itself before it can serve others, even just for DHCP.

It is generally recommended that DHCP servers should always have a static IP address, no matter what the OS.

If a DHCP server's address changes while there are DHCP clients relying on it, those clients usually can no longer smoothly update their address leases, and once the leases expire, they will have to start the DHCP process from scratch. As a result, the clients will be without an IP address for a while, and may receive an address that is different from before, so their on-going TCP sessions will be cut off. That tends to make users unhappy.

hummingbird hoedown
Sep 23, 2004


IS THAT A STUPID NEWBIE AVATAR? FUCK NO, YOU'RE GETTING A PENTAR

SKILCRAFT KREW Reppin' Quality Blind Made Products

telcoM posted:

Sure it can, and I would almost say it _must_ have that.

The server needs to have a valid IP address configuration for itself before it can serve others, even just for DHCP.

Can the server, not connected to the internet, assign itself an IP address if it's not connected to the internet or router?

The setup I'm trying to work out isn't connected to the internet at all. I'll download the necessary packages to the server with an internet connection then relocate the server to a location without internet access where the server will need to have an IP address and lease IP addresses to clients located on this internet-less LAN. Will dnsmasq do this?

MF_James
May 8, 2008
I CANNOT HANDLE BEING CALLED OUT ON MY DUMBASS OPINIONS ABOUT ANTI-VIRUS AND SECURITY. I REALLY LIKE TO THINK THAT I KNOW THINGS HERE

INSTEAD I AM GOING TO WHINE ABOUT IT IN OTHER THREADS SO MY OPINION CAN FEEL VALIDATED IN AN ECHO CHAMBER I LIKE

Hummer Driving human being posted:

Can the server, not connected to the internet, assign itself an IP address if it's not connected to the internet or router?

The setup I'm trying to work out isn't connected to the internet at all. I'll download the necessary packages to the server with an internet connection then relocate the server to a location without internet access where the server will need to have an IP address and lease IP addresses to clients located on this internet-less LAN. Will dnsmasq do this?

Yes, you manually assign an address to the adapter.

Adbot
ADBOT LOVES YOU

telcoM
Mar 21, 2009
Fallen Rib

Hummer Driving human being posted:

Can the server, not connected to the internet, assign itself an IP address if it's not connected to the internet or router?
Not with standard DHCP.

But you can just set a static IP address to the server's interface in that case. Just make sure it's excluded from the range of IP addresses the DHCP server software will offer to the clients.

For example, if you decide to use IP address range 192.168.99.[1..254] for your private network, then the netmask would be 255.255.255.0: broadcast address would be 192.168.99.255 and "network address", in the rare case something needs it explicitly specified, will be 192.168.99.0.

Then you decide to put the server as 192.168.99.1.

On Debian-style systems including Ubuntu, you can do this by putting the following lines into /etc/network/interfaces:
code:
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 192.168.99.1
        netmask 255.255.255.0
        dns-nameserver 192.168.99.1 # this will be the local dnsmasq once it comes up
Since there is no internet connection (through this interface at least), you don't specify a default gateway.

Now any time the server detects a link on network interface eth0, it will automatically configure the interface as 192.168.99.1, whether dnsmasq or any other DHCP server is running or not.

When configuring dnsmasq, you now know 192.168.99.1 is occupied by definition (that's the server you're running dnsmasq on).
So the maximal range of IP addresses you can give to your DHCP clients is 192.168.99.[2 .. 254].

In dnsmasq configuration, that is:
code:
dhcp-range=192.168.99.2,192.168.99.254,12h
If it turns out your network has other things for which you would rather configure a static IP address (like an old clunky network printer with a known bad DHCP implementation), you can just shorten that range at either end to leave a sufficient number of IP addresses unallocated by DHCP, and then configure those DHCP-deficient things to those addresses.

Hummer Driving human being posted:

The setup I'm trying to work out isn't connected to the internet at all. I'll download the necessary packages to the server with an internet connection then relocate the server to a location without internet access where the server will need to have an IP address and lease IP addresses to clients located on this internet-less LAN. Will dnsmasq do this?

Yes.

But when the server starts up, it will set up network interfaces before starting up any network services like dnsmasq. In that phase, the system cannot ask dnsmasq what its IP address should be because dnsmasq is not running yet at that point.

And if you configure dnsmasq to start up before network interfaces, it will just go "oh look, there are no network interfaces running, so I cannot start up a DHCP service" and either abort with an error message, or just sit on its virtual rear end waiting for at least one network interface to become fully configured before it can start up a DHCP server on it.

Background:
When a DHCP server gives an IP address to a DHCP client, it will also tell the client: "This IP address is yours for the next <lease time> seconds. Once half of that is gone, call me again at <server's IP address> and I'll extend that lease for you." If the server does not know its own IP address yet, it cannot give this answer, and so cannot successfully act as a DHCP server.

(Sorry about not going into details earlier - I was phoneposting.)

  • Locked thread