Workaround for ISP not sending IPv6 router advertisement

Hi,

I am running OpenWrt 19.07.9 on Linksys WRT1200AC.

I have a problem with my ISP not sending IPv6 Router Advertisement except as a response to Router Solicitation messages. The connection is a PPPoE and everything works initially, but after 30 minutes the the default route expires and IPv6 stops working. I can fix this by manually setting the route again, but I have not found an easy way to automate this.

With tcpdump I can see that when the wan6 link is restarted, openwrt sends out RS and the ISP responds with a RA message. IPv6 starts working again for 30 minutes. However this resets the connections, so it is not ideal.

Is there a way to get openwrt to send RS message at every DHCPv6 renew?

I found an old thread, which suggested using ndisc6 to send RS through a cronjob. Unfortunately I was not able to compile it (error below).

Any suggesting on possible solutions would be much appreciated!

src/trace-tcp.c: In function 'send_syn_probe':
src/trace-tcp.c:52:21: error: invalid application of 'sizeof' to incomplete type 'struct tcphdr'
  if (plen < sizeof (struct tcphdr))
                     ^~~~~~
src/trace-tcp.c:53:18: error: invalid application of 'sizeof' to incomplete type 'struct tcphdr'
   plen = sizeof (struct tcphdr);
                  ^~~~~~
In file included from src/trace-tcp.c:29:
src/trace-tcp.c:55:2: error: invalid application of '__alignof__' to incomplete type 'struct tcphdr'
  alignas (struct tcphdr) char buf[plen];
  ^~~~~~~
src/trace-tcp.c:58:17: error: field 'th' has incomplete type
   struct tcphdr th;
                 ^~
src/trace-tcp.c:59:11: error: flexible array member in a struct with no named members
   uint8_t payload[];
           ^~~~~~~
src/trace-tcp.c:67:24: error: 'TH_SYN' undeclared (first use in this function); did you mean 'TH_ECE'?
  packet->th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);
                        ^~~~~~
                        TH_ECE
src/trace-tcp.c:67:24: note: each undeclared identifier is reported only once for each function it appears in
src/trace-tcp.c: In function 'parse_syn_resp':
src/trace-tcp.c:81:21: error: dereferencing pointer to incomplete type 'const struct tcphdr'
  if ((len < sizeof (*pth))
                     ^~~~
src/trace-tcp.c:84:24: error: 'TH_ACK' undeclared (first use in this function); did you mean 'TH_ECE'?
   || ((pth->th_flags & TH_ACK) == 0)
                        ^~~~~~
                        TH_ECE
src/trace-tcp.c:85:25: error: 'TH_SYN' undeclared (first use in this function); did you mean 'TH_ECE'?
   || (((pth->th_flags & TH_SYN) != 0) == ((pth->th_flags & TH_RST) != 0))
                         ^~~~~~
                         TH_ECE
src/trace-tcp.c:85:60: error: 'TH_RST' undeclared (first use in this function); did you mean 'TH_ECE'?
   || (((pth->th_flags & TH_SYN) != 0) == ((pth->th_flags & TH_RST) != 0))
                                                            ^~~~~~
                                                            TH_ECE
src/trace-tcp.c: In function 'parse_syn_error':
src/trace-tcp.c:107:10: error: dereferencing pointer to incomplete type 'const struct tcphdr'
   || (pth->th_sport != sport)
          ^~
src/trace-tcp.c: In function 'send_ack_probe':
src/trace-tcp.c:130:21: error: invalid application of 'sizeof' to incomplete type 'struct tcphdr'
  if (plen < sizeof (struct tcphdr))
                     ^~~~~~
src/trace-tcp.c:131:18: error: invalid application of 'sizeof' to incomplete type 'struct tcphdr'
   plen = sizeof (struct tcphdr);
                  ^~~~~~
In file included from src/trace-tcp.c:29:
src/trace-tcp.c:133:2: error: invalid application of '__alignof__' to incomplete type 'struct tcphdr'
  alignas (struct tcphdr) char buf[plen];
  ^~~~~~~
src/trace-tcp.c:136:17: error: field 'th' has incomplete type
   struct tcphdr th;
                 ^~
src/trace-tcp.c:137:11: error: flexible array member in a struct with no named members
   uint8_t payload[];
           ^~~~~~~
src/trace-tcp.c:145:24: error: 'TH_ACK' undeclared (first use in this function); did you mean 'TH_ECE'?
  packet->th.th_flags = TH_ACK;
                        ^~~~~~
                        TH_ECE
src/trace-tcp.c: In function 'parse_ack_resp':
src/trace-tcp.c:159:21: error: dereferencing pointer to incomplete type 'const struct tcphdr'
  if ((len < sizeof (*pth))
                     ^~~~
src/trace-tcp.c:162:23: error: 'TH_SYN' undeclared (first use in this function); did you mean 'TH_ECE'?
   || (pth->th_flags & TH_SYN)
                       ^~~~~~
                       TH_ECE
src/trace-tcp.c:163:23: error: 'TH_ACK' undeclared (first use in this function); did you mean 'TH_ECE'?
   || (pth->th_flags & TH_ACK)
                       ^~~~~~
                       TH_ECE
src/trace-tcp.c:164:24: error: 'TH_RST' undeclared (first use in this function); did you mean 'TH_ECE'?
   || ((pth->th_flags & TH_RST) == 0)
                        ^~~~~~
                        TH_ECE
src/trace-tcp.c: In function 'parse_ack_error':
src/trace-tcp.c:186:10: error: dereferencing pointer to incomplete type 'const struct tcphdr'
   || (pth->th_sport != sport)
          ^~

Does this help?
killall -SIGUSR1 odhcp6c

Thank you for your reply. Unfortunately it does not really help :frowning:

It sends a DHCPv6 renew, but no Router Solicitation message, so no Router Advertisement is received and routes are not updated.

Checking with "ifstatus wan6" shows me that the "route" part is still empty.