openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
163 stars 99 forks source link

auto assign for more than /64 prefix, subnet for /112 #164

Open youxiaojie opened 3 years ago

youxiaojie commented 3 years ago

can odhcpd can assign a /112 ipv6 for clients? I get /64 from isp, so I can only divided /64 to subnets. therefore slaac is missing.what I hope is to use dhcpv6 to assign ipv6 automaticly. how to do it? is it feasible?(I noticed it can only assign /64 ipv6, or something I have wrong?)

icpz commented 3 years ago

odhcpd does not support a prefix > 64.

Is your /64 from isp IPv6-PD or SLAAC-ed address?

If it's IPv6-PD, then is ok for odhcpd to function for just one subnet. Or if it's address via SLAAC, you may need relay mode (see here for detail).

youxiaojie commented 3 years ago

dhcp dp is easy, the br-lan will got it automatically, and the system will add route to the pd-prefix. pppoe is ok with dhcp pd.

and I tried different school lan, most is lan-like, 1.give me /112 (residential lan,write down on paper), so I must subdivided to /120 and set each ipv6 on pc manually, the route item will add by system automatic and ping6 is ok because of /120 is subnet of /112, the route is ok to my pc. (I want to ask for dhcp v6 is there some ip pool like ipv4 auto assigned to users),and I can also cascade layer3 router.(eg, in rented house)

  1. another give me a fixed ipv6 /64 (campus lan, I don't konw whether it is slaac, some pppoe does so), in this situation, relay maybe ok.(is this the same theory to #sysctl net.ipv6.conf.all.proxy_ndp=1 #ip neigh add proxy ... but automaticlly? ) is the way only permit one openwrt? (one broadcast area not permit cascade router? if want to expand client, we must use layer2 switch/hub?

3.the worst give me a /128 ipv6(802.1x, definitely dhcpv6), in this one, must we use NAT like ipv4? I think so.

so every professor, could you help to analyze this 3-situation? thanks.

icpz commented 3 years ago

1.give me /112 ... (I want to ask for dhcp v6 is there some ip pool like ipv4 auto assigned to users),and I can also cascade layer3 router.(eg, in rented house)

It's ok in theory, but odhcpd doesn't support it, though. You may try wide-dhcpv6.


2.another give me a fixed ipv6 /64 (campus lan, I don't konw whether it is slaac, some pppoe does so), in this situation, relay maybe ok.

FYI, relay mode may not work in some misconfigured environment. E.g. the upstream won't send NS to WAN before delivering the packet, in which case relay mode won't function (this article might be helpful in such case).

(is this the same theory to #sysctl net.ipv6.conf.all.proxy_ndp=1 #ip neigh add proxy ... but automaticlly? )

Yes, relay mode does this automatically. You may check src/ndp.c for implementation detail.

is the way only permit one openwrt? (one broadcast area not permit cascade router? if want to expand client, we must use layer2 switch/hub?

If the relay mode works for you, then you can setup the cascade routes all in relay mode in theory.


3.the worst give me a /128 ipv6(802.1x, definitely dhcpv6), in this one, must we use NAT like ipv4? I think so.

Yes, you're right.

youxiaojie commented 3 years ago

Thanks very much!!! before I only noticed on luci interface, now I can edit configure file to get more function than luci interface. 1.can I use wide-dhcpv6 in openwrt? does it conflict with odhcpd? If /64 pd is available all is simple and odhcpd in charge of ipv6 assignment.if no /64prefix, using wide-dhcpv6 for v6 assignment, therefore I can use this one route in first two situation.

2.does the odhcpd contain the function of ndppd/dnp6 and radvd, and specifically for openwrt(It seems that the repo of openwrt has ndppd/dnp6 and radvd)? in linux pc with muli-ethercard, can we only used ndppd/dnp6 and radvd which no maintance for a long time?

icpz commented 3 years ago

1.can I use wide-dhcpv6 in openwrt? does it conflict with odhcpd? If /64 pd is available all is simple and odhcpd in charge of ipv6 assignment.

opkg seems to have wide-dhcpv6-server removed... but there is an isc-dhcp-server-ipv6 instead. Yes it will be conflict with odhcpd, so you may disable one of them.

if no /64prefix, using wide-dhcpv6 for v6 assignment, therefore I can use this one route in first two situation.

You can write custom scripts to achieve this. Both /etc/odhcp6c.user and /etc/hotplug.d/*/ might help.


2.does the odhcpd contain the function of ndppd/dnp6 and radvd, and specifically for openwrt(It seems that the repo of openwrt has ndppd/dnp6 and radvd)?

What is dnp6 BTW? radvd is deprecated in openwrt by odhcpd which contains the main functions of ndppd, radvd and dhcpv6d.

in linux pc with muli-ethercard, can we only used ndppd/dnp6 and radvd which no maintance for a long time?

Sure, here's a link that might be helpful.

youxiaojie commented 3 years ago

great! thanks for give me a way of thought. any way, I try isc-dhcp-server-ipv6 first. isc-dhcp-server-ipv6 and odhcpd is conflict, so uninstall odhcpd and install ndppd, radvd and isc-dhcp-server-ipv6, configure manually. thanks!! such a huge file! isc-dhcp-relay-ipv4 4.4.1-3 772.6 KB isc-dhcp-relay-ipv6 4.4.1-3 843.8 KB isc-dhcp-server-ipv4 4.4.1-3 928.5 KB isc-dhcp-server-ipv6 4.4.1-3 961.2 KB

odhcpd also incharge of ipv4's assign, and isc-v4 and isc-v6 nearly 4MB! so I love your odhcpd! Do nearly all most frequently used v4 v6 function in a small package. Great odhcpd!

youxiaojie commented 3 years ago

What is dnp6 BTW? radvd is deprecated in openwrt by odhcpd which contains the main functions of ndppd, radvd and dhcpv6d.

https://github.com/npd6/npd6

sorry typo

youxiaojie commented 3 years ago

1.give me /112 ... (I want to ask for dhcp v6 is there some ip pool like ipv4 auto assigned to users),and I can also cascade layer3 router.(eg, in rented house)

It's ok in theory, but odhcpd doesn't support it, though. You may try wide-dhcpv6.

dear friend, if I hope to auto sign /112,etc with kea dhcpv6(wide is unavailable in repository), does it cooperate with odhcpd? I need ra and ndp proxy function.

icpz commented 3 years ago

Sorry, I'm not familiar with the kea dhcpv6...

youxiaojie commented 3 years ago

kea is the isc dhcpv6 before.