Need help with making ipv6 work

So I have a router with openwrt 19.07 installed.
My phone A connects to a openwrt router, which connects to another router 'X' which connects to my internet service provider. ipv4 worked after connecting my openwrt router to X, but ipv6 worked only on my openwrt router (after adding a dhcpv6 interface to wlan0, (which connected to X) )and ipv6 didnt work on my phone A.

When I tried to ping6 openwrt.org, I would get connect: network unreachable, but after setting always annouce default router in luci > interfaces > lan > dhcp server > ipv6 settings, i started getting from openwrt.lan destination unreachable: unknown code 5 when i tried to ping6 openwrt.org.

Here is my /etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'xxxxxxx'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0.1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device 'lan_eth0_1_dev'
	option name 'eth0.1'
	option macaddr 'redacted'

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

config device 'wan_eth0_2_dev'
	option name 'eth0.2'
	option macaddr 'redacted'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

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

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

config interface 'wwan'
	option proto 'dhcp'

config interface 'wwan6'
	option proto 'dhcpv6'
	option reqaddress 'try'
	option reqprefix '64'

I also changed router advertisement settings and dhcpv6 service from server mode to hybrid mode in interface > lan > dhcp server > ipv6 setting , just to see if it work
and /etc/config/dhcp


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_default '1'
	option ra_management '1'
	option ra 'hybrid'
	option dhcpv6 'hybrid'

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'

Can someone please tell me what is wrong? Any help would be really appreciated.
Thanks

What is the output of ifstatus wwan6 ?
Also you can revert the option reqprefix to 'auto' under wwan6 interface.

3 Likes

thanks for replying

{
	"up": true,
	"pending": false,
	"available": true,
	"autostart": true,
	"dynamic": false,
	"uptime": 123,
	"l3_device": "wlan0",
	"proto": "dhcpv6",
	"device": "wlan0",
	"updated": [
		"addresses",
		"routes",
		"data"
	],
	"metric": 0,
	"dns_metric": 0,
	"delegation": true,
	"ipv4-address": [
		
	],
	"ipv6-address": [
		{
			"address": "2xxxxxx:xxxxxxxxxxxxxxxxx:94ff:fec9:xx",
			"mask": 64,
			"preferred": 14277,
			"valid": 86277
		}
	],
	"ipv6-prefix": [
		
	],
	"ipv6-prefix-assignment": [
		
	],
	"route": [
		{
			"target": "2406:7400:73:672::",
			"mask": 64,
			"nexthop": "::",
			"metric": 256,
			"valid": 86277,
			"source": "::/0"
		},
		{
			"target": "::",
			"mask": 0,
			"nexthop": "fe80::23xxxxxxx9886",
			"metric": 512,
			"valid": 1677,
			"source": "2406:7xxxxxxxxxxxxxxxxxec9:85/64"
		}
	],
	"dns-server": [
		"2406:7400:a:10::2",
		"2406:7400:b0:b::2"
	],
	"dns-search": [
		
	],
	"neighbors": [
		
	],
	"inactive": {
		"ipv4-address": [
			
		],
		"ipv6-address": [
			
		],
		"route": [
			
		],
		"dns-server": [
			
		],
		"dns-search": [
			
		],
		"neighbors": [
			
		]
	},
	"data": {
		"passthru": "0017002024067400000a001000000000000000022406740000b0000b0000000000000002"
	}
}

This was the output

You are getting an address in a /64 without any delegated prefix. If the X router doesn't delegate a prefix downstream, your best bet is relay.

3 Likes

Sorry if it is a dumb question, but in my case i would use wwan6 instead of wan6 right?

That's right!

3 Likes

THANKS a lot for the help, that worked, really appreciate your responses, kind sir!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.