Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3609 - odhcpd: doesn't set M flag nor O flag in router advertisment when using isc-dhcp-server-ipv6 #8640

Closed
openwrt-bot opened this issue Feb 7, 2021 · 2 comments
Labels

Comments

@openwrt-bot
Copy link

eltorio:

Hi,
On OpenWRT 19.07.6 on a TP-Link Archer C7 AC1750 v5 connecting a small site to Internet and to other corporate subnets via an IPSEC tunnel for IPv4 and a 6in4 tunnel (inside the ipsec tunnel for IPv6)

I 'd like to use isc bind9 and dhcp server for both ipv4 and ipv6 (for having advanced features) in replacement of dnsmasq/odhcpd
I remove dnsmasq but let odhcpd because radvd is not available in current version

My router establish automatically an IPSEC tunnel to a main site and in this tunnel use a 6in4 tunnel for provinding IPv6 to the "openwrt" site
I also put a static address for lan ipv6 and 6in4 tunnel

This is my network config
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'

config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.5.254'
list ip6addr '2001:xxxx:xxxx:xxxx:200::254/72'
list dns '127.0.0.1'

config interface 'wan'
option ifname 'eth0.2'
option proto 'dhcp'

config device 'wan_eth0_2_dev'
option name 'eth0.2'
option macaddr 'e4:xx:xx:xx:xx:33'

config interface 'wan6'
option ifname 'eth0.2'
option proto '6in4'
option ipaddr '192.168.5.254'
option ip6addr '2001:xxxx:xxxx:xxxx:aaab::2/112'
option peeraddr '192.168.15.1'
option ip6gw '2001:xxxx:xxxx:xxxx:aaab::1'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
option ar8xxx_mib_type '0'
option ar8xxx_mib_poll_interval '500'

config switch_vlan
option device 'switch0'
option vlan '1'
option ports '2 3 4 5 0t'

config switch_vlan
option device 'switch0'
option vlan '2'
option ports '1 0t'

config route6
option target '2000::/3'
option gateway '2001:xxxx:xxxx:xxxx:aaab::1'
option metric '100'
option interface 'wan6'

config interface 'wwan'
option proto '3g'
option device '/dev/ttyUSB0'
option service 'umts'
option apn 'xxxx'
option ipv6 '0'
option delegate '0'

This is my IPSEC config
config 'ipsec'
option 'debug' '2'
option 'zone' 'vpn'

config 'remote' 'LxxxxxxS'
option 'enabled' '1'
option 'gateway' 'XXX.XXX.XXX.XXX'
option 'local_identifier' 'cxxxxxxxxxxxxxxxxxm'
option 'remote_identifier' 'xxxxxxxxxxxxxxxxxxxxxm'
option 'authentication_method' 'psk'
option 'pre_shared_key_old' '77xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf'
option 'pre_shared_key' '8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx8e'
list 'tunnel' 'vpn'
list 'p1_proposal' 'pre_g2_aes_sha256'

config 'p1_proposal' 'pre_g2_aes_sha256'
option 'encryption_algorithm' 'aes256'
option 'hash_algorithm' 'sha256'
option 'dh_group' 'modp2048'

config 'p2_proposal' 'g2_aes_sha256'
option 'pfs_group' 'modp2048'
option 'encryption_algorithm' 'aes256'
option 'authentication_algorithm' 'sha256'

config 'tunnel' 'vpn'
option 'local_subnet' '192.168.5.0/24'
option 'remote_subnet' '192.168.15.0/24,192.168.168.0/24,192.168.92.0/24,192.168.2.0/24,192.168.115.0/24'
option 'p2_proposal' 'g2_aes_sha256'

I config my /etc/config/dhcp like this

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option ra 'server'
option ra_mininterval '1'
option ra_maxinterval '20'
option ra_management '2'

but odhcpd does not set M flag nor O flag
I tried to add option ignore '1' without success
This is a screen capture of a Wireshark sniffing on the WiFi network {{http://i.ibb.co/QKK13Cn/107125841-6dc19980-68ac-11eb-94b9-bc932244974c.jpg}} also putted in attachement
Finally I attached my package list

@openwrt-bot
Copy link
Author

eltorio:

Hi forgot to give complete /etc/config/dhcp
remark: I tried with or without option ignore '1'
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'

config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option ra 'server'
option ra_mininterval '1'
option ra_maxinterval '20'
option ra_management '2'
option ignore '1'

config dhcp 'wan'
option interface 'wan'
option ignore '1'

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

config isc_dhcpd 'isc_dhcpd'
option authoritative '1'
option default_lease_time '3600'
option max_lease_time '86400'

@openwrt-bot
Copy link
Author

dedeckeh:

In 19.07 the M-flag and O-flag are tied to the odhcpd DHCPv6 server status; meaning if the odhcpd DHCPv6 server is disabled the M-flag and O-flag will not be set.
In the upcoming 20.x release it's possible to set the M-flag and O-flag independent from the odhcpd DHCPv6 server via the ra_flags uci option (https://git.openwrt.org/?p=project/odhcpd.git;a=commit;h=d11180932b2fb8784aaad0830c032e42b8bb64ac).
So this will be fixed in the upcoming release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant