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

[Request] Support for double-direction ndp relay #66

Open chaserhkj opened 8 years ago

chaserhkj commented 8 years ago

Hi, there.

Currently odhpcd supports relay mode for ndp, offering the feature for proxying NS packets from external interface of the router to the internal interface, making outside ipv6 packets possible to be routed to internal hosts which has a global ipv6 address.

This works like a charm when a whole subnet has been delegated to the router by ISP router, but the ISP router did not have routing rules to route to subnet hosts, like this:

nw0

In this case, packets from PC A or from the internet could be routed, hopping on ISP router, then by proxyed NS and NA packets, being transmitted (not actually routed, right?) to router, and then to PC B and PC C. On the other hand, hopping on router, packets from internal subnet (PC B and PC C) could also be routed to PC A or to the internet.

However, my network use case is quite different from this scene, and thus reqires more features on odhcpd. Our school network does not even delegate 64-bit prefixes to our hosts, it delegates addresses using SLAAC in the 64-bit prefixed subnet. The network structure works like this:

nw

So running a router to extend my local link actually forms a network in such a way that one same 64-bit prefixed subnet owns 2 separated links, my internal one that connects my devices with my router ,and the external one that connects my router with the school router. I do not have any control over the school router, so I can't change this.

Running odhcpd in relay mode does help a lot in this case, Let me analyze the situation

So in this use case, the most elegant way working out of this would be providing odhcpd the feature to proxy ndp packets from interal interface back to external interface, that's why I'm here firing a feature request, would you consider about it?

Cheers, Chaserhkj

Attachment:

my odhcpd configuration

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option ndp 'relay'
        option ra 'relay'

config dhcp 'wan'
        option interface 'wan'
        option ndp 'relay'
        option ra 'relay'
        option master '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'