Hello every one, I have two wan interface, both have ipv4/ipv6,
I use wan1 as my default route , and use wan2 for some other customized route.
but I've found that openwrt write both interface dns settings into same dnsmasq file, that leads some dns query answered by wan2 dns ,which is not suitable for my default route (wan1). I've already uncheck "Use DNS servers advertised by peer" option, but that only disable wan2 ipv4 dns server, wan2 ipv6 dns server still in dnsmasq file, is this expected behavior or a bug ?How can I disable wan2 ipv6 dns server(but still enable wan2 ipv6) ?
here is my /tmp/resolv.conf.auto file
# Interface wan2 ==> after uncheck Use DNS servers advertised by peer, only wan2 ipv4 server disabled
# Interface wan2_6 ==> but wan2 ipv6 dns server still preserved
nameserver 2409:8020:2000::88
nameserver 2409:8020:2000::8
# Interface wan1
nameserver 221.228.255.1
nameserver 218.2.135.1
# Interface wan1_6
nameserver 240e:5a::6666
nameserver 240e:5b::6666
I can write a script to strip these lines and restart dnsmasq each time wan2 connected, is there better solution ?
With this option, OpenWrt spawns a wan_6 and wan2_6 interface automatically with some failsafe settings, but non-configurable.
Change that to '1' or manual in Luci. Then you can configure the IPv6 interface of the wan and wan2 to your liking.
Thanks for the information. set wan2 ipv6 option to 1 just lose wan2 ipv6 address, do you mean I need to run dhcpv6 manually on wan2 (everytime PPPoE up)? if so , I think it makes no big differences to 'strip unwanted lines'
uci set network.wan.ipv6="auto"
uci set network.wan2.ipv6="auto"
uci set network.wan.peerdns="0"
uci set network.wan6.peerdns="0"
uci set network.wan2.peerdns="0"
uci commit network
/etc/init.d/network restart
If that doesn't help, then use ipv6=1 together with IPv6 aliases for each upstream interface and configure peerdns=0 for each alias.
I didn't use uci command, I just add ipv6 aliases in config based on your advise:
config interface 'wan26'
option ifname 'eth0.3'
option proto 'dhcpv6'
and openwrt web page shows it as 'DHCPv6 client' interface, and I set peerdns = 0 on this interface, finally ipv6 dns server didn't appear in resolve.conf.auto
by the way, my wan2 pppoe config still keeps ipv6 = auto. I found if set it to manual, wan2 can not got ipv6 address automatically