How to install odhcpd

I would like to install odhcpd, but I can't.

git clone git@github.com:openwrt/odhcpd.git
cd odhcpd
cmake .

It worked well until this point.

However, when I try to execute make, it fails.

[ 12%] Building C object CMakeFiles/odhcpd.dir/src/odhcpd.c.o
/home/ubuntu/odhcpd/src/odhcpd.c:43:10: fatal error: libubox/uloop.h: No such file or directory
   43 | #include <libubox/uloop.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/odhcpd.dir/build.make:76: CMakeFiles/odhcpd.dir/src/odhcpd.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/odhcpd.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I'm very new to this kind of project, so I would be grateful if you could teach me in a way that's easy to understand as much as possible.

Installed libubox-dev/devel?

Isn’t odhcpd always installed by default?

And why build it? It is a normal package in opkg.

@flygarn12 I'm afraid, but I'm unfamiliar with it, so I'm in a situation where I don't even understand how to use it. What kind of command can I confirm that it's installed with?

@frollic No, I'm new to it, so I don't know what I need to use it and how to prepare it.

You need the libulib devel package installed on your Ubuntu host, how to get it there, it's a question for Ubuntu, not openwrt.

used and installed where ?

@frollic Well, what I'm trying to do is rewrite IPv6 addresses assigned by an Internet service provider's router on an Ubuntu machine (Raspberry Pi). Is my recognition that it's feasible by odhcpd right in the first place?

I don't even understand how to use it. What kind of command can I confirm that it's installed with?

This is just what I've responded to the question @flygarn12 mentioned, because @flygarn12 says, "Isn’t odhcpd always installed by default?" I've never installed odhcpd by myself intentionally.

no idea :confused:

he's talking about openwrt, you probably aren't.
hence the question where you used/installed it.

@frollic

Is my recognition that it's feasible by odhcpd right in the first place?

What I mean by this question is whether I can resolve this by odhcpd.

If it's not suitable for the solution of that question, I'm not going to use it.

he's talking about openwrt, you probably aren't.
hence the question where you used/installed it.

I haven't installed OpenWrt yet. Is that necessary to use odhcpd?

Odhcpd in an OpenWrt-specific tool, so the answer is yes.
And OpenWrt is a router operating system (Linux-variant) that targets router devices.

You can't just take odhcpd into a vanilla Unix/Linux/something.

it's the intended use, there you wouldn't need to compile it.

if it works on another OS, no idea.

@hnyman Oh, I see. I've just noticed that I can't install odhcpd on my Raspberry Pi.

I've heard that question can be resolved by 6relayd, and I would've thought it would have been replaced with odhcpd.

I have no idea what I should use to achieve my purpose then, so I'm completely stuck. But thank you for teaching me that odhcpd is not in line with this objective.

that's what @flygarn12 pointed out, it should already be there ...

@frollic As I said in the first, I'm completely new to it, so I didn't know what it specifically meant. I'm very sorry for bothering you.

I have no idea what I should use to achieve my purpose then, so I'm completely stuck, but thank you for teaching me a lot.

I don’t know how it works, but I always remove it (and it’s twin package with similar name, like odhcpd6 or something like that?) in my builds since Sweden pretty much doesn’t have IPv6. That is why I know it is always installed per default.

I think that package is the IPv6 dhcp client to the ISP connection. And the other package is the internal IPv6 dhcp server. Or the other way around🤔

But all standard OpenWrt builds have all it needs per default to make IPv6 work.

For IPv4 dnsmasq does both upstream and downstream dhcp work.

you could still try to compile it, shouldn't be rocket science.
yes, it's intended for openwrt, but might just work for any-OS too, trial and error.

No. But odhcpd-ipv6only is. The full odhcpd is a DHCPv4 and DHCPv6 server.

I'll assume you want to use odhcpd on OpenWrt? And it seems like you are compiling outside the buildroot. The standalone git repo odhcpd has is meant for development, not for deployment (ie building packages). Use the buildroot, select your target, make sure odhcpd is selected (and odhcpd-ipv6only isn't), then run your build, copy the package over.

Or just grab the package from a recent master build for your architecture? Is there a reason why you're not doing that but compiling it?

He is trying to just use odhcpd in Ubuntu without OpenWrt...

And that usage is not easily possible.
(like the error first message above indicates, the the next OpenWrt library needed would be libubox, and the next one after that is...)

@frollic I could give it a shot if my purpose could be achieved. But in that case, I'd like to know whether my desire really might be accomplished in advance.

@hnyman Now that I understand odhcpd isn't in line with my objective, I could give up using it and try to figure out another way. I have no clue, though.