4

My syslog looks like this:

Apr  1 19:05:25 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:07:35 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:10:26 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:13:10 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:15:13 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:17:01 raspberrypi CRON[8809]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Apr  1 19:18:05 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:20:41 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:24:41 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:27:49 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:29:30 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:29:43 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:31:25 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:35:23 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170
Apr  1 19:36:25 raspberrypi dhcpcd[699]: eth0: Router Advertisement from fe80::c23e:fff:fe63:5170

I'm struggling to understand what this is, but it makes scanning through syslog somewhat annoying (I'm new to Linux and setting things up on Raspbian Jessie Lite and trying to keep an eye on this to make sure nothing I'm setting up is causing issues).

I found lots of info online saying I should put noipv6rs in /etc/dhcpcd.conf however the manual says Disable solicitation and receipt of IPv6 Router Advertisements. It's not clear to me what the implications of this are; I really just want it not to spam my logs rather than changing any behaviour.

I'm really not interesting in changing DHCP client or anything from now (I'm trying to make the minimum changes possible to the Raspbian Jessie Lite image).

So; what are the implications of setting noipv6rs and/or is there a better way? Should I just set logfile and let DHCP log to another place and ignore it?

  • Ignore my rant - I got the name mixed up. dhcpcd is a client, not a server. Stopping it would cause you to have issues as you stated :-) – garethTheRed Apr 2 '16 at 20:31
  • If you set noipv6rs then the dhcp client will ignore any router advertisements, which is what you seem to be after. It will only affect you if you are using IPv6. A router advertisement is the way that the IP address of the router (your default gateway) is distributed in IPv6. In IPv4 you could set it manually or via DHCP. In IPv6 you can set it manually or it can be sent using router advertisements. DHCP has no facility to send default gateway in IPv6. If you're not using IPv6 then you could try to configure your router not to send the advertisements - that would stop the log entries. – garethTheRed Apr 2 '16 at 20:39
  • I don't need IPv6 (does anybody? :)) though my preference would be to stop this logging without actually disabling it. If it's not possible to stop the logging (it seems kinda silly/spammy to fill syslog with this by default?) then maybe I'll just do that; nothing really lost. I presume from your comments that setting noipv6rs will entirely disable ipv6 (or, stop it from knowing the gateway, effectively making it not work?) – Danny Tuppeny Apr 2 '16 at 21:45
  • Setting noipv6rs should make dhcpcd ignore the advertisements and therefore not log the fact that it's received them from the router. There is also nopiv6 which disables IPv6 altogether and the ipv4only option, which may help. I'm not certain what the difference is between the two though! – garethTheRed Apr 3 '16 at 7:21
  • I would be more worried with having a link local address announcing himself as the gateway...find the offending equipment and configure it to not advertise as a router. Talk with the networking team if at work, they will thank you. – Rui F Ribeiro Apr 3 '16 at 8:35
4

Raspbian uses rsyslog as its syslog service. If you check out the rsyslog documention on filter conditions it can tell you how to do this for any filter operation.

To answer your specific question you could put this line near the top of the rsyslog config file (usually located at /etc/rsyslog.conf):

:msg, contains, "Router Advertisement from" stop

Let me break that down...

:msg This specifies that you are going to be looking at the syslog message body

contains can be anywhere within the message

"Router Advertisement from" This is what you're searching for

~ This is the discard action

You should also take note that the placement within the file is relevant as actions are performed in sequence. The discard example within the documentation explains this in more detail.

1

I checked out why; it doesn't help you but maybe it's interesting. I hadn't noticed this with an OpenWrt router with IPv6 support.

/* We don't want to spam the log with the fact we got an RA every
 * 30 seconds or so, so only spam the log if it's different. */
if (options & DHCPCD_DEBUG || rap == NULL ||
    (rap->expired || rap->data_len != len ||
     memcmp(rap->data, (unsigned char *)icp, rap->data_len) != 0))
{
    if (rap) {
        free(rap->data);
        rap->data_len = 0;
    }
    syslog(LOG_INFO, "%s: Router Advertisement from %s",
        ifp->name, sfrom);

I haven't confirmed this could cause the message, but looking at the above test I noticed one suspect. It will log if the RA "expires" before the next one is received. Later versions downgrade the message to a debugging statement, and describe a related reason.

/* We could change the debug level based on new_data, but some
     * routers like to decrease the advertised valid and preferred times
     * in accordance with the own prefix times which would result in too
     * much needless log spam. */
    logger(ifp->ctx, new_rap ? LOG_INFO : LOG_DEBUG,
        "%s: Router Advertisement from %s",
        ifp->name, ctx->sfrom);

It's completely legal to send Router Advertisements which expire immediately. Apparently it's supposed to indicate that the source should not be used as a default router, but the announcement can provide other information which will have its own lifetime. (Maybe specific routes or DNS servers, for example).

Router Lifetime

16-bit unsigned integer. The lifetime associated with the default router in units of seconds. The field can contain values up to 65535 and receivers should handle any value, while the sending rules in Section 6 limit the lifetime to 9000 seconds. A Lifetime of 0 indicates that the router is not a default router and SHOULD NOT appear on the default router list. The Router Lifetime applies only to the router's usefulness as a default router; it does not apply to information contained in other message fields or options. Options that need time limits for their information include their own lifetime fields.

Both of the router behaviors I mention are specifically recommended, in the case of your average "customer edge router."

To support host implementations that do not handle multihoming in a multi-prefix environment [MULTIHOMING-WITHOUT-NAT], the IPv6 CE router should not, as detailed in the requirements below, advertise itself as a default router on the LAN interface(s) when it does not have IPv6 connectivity on the WAN interface or when it is not provisioned with IPv6 addresses.

This concept could go poorly if you have any legacy setup that relies on IPv4 working properly (legacy DHCP does not support multiple routers). Maybe old network printers, or Linux using MDNS implemented by Avahi to discover other computers and printers, which is disabled for IPv6 by default.

1

My Raspbian comes with the dhcpcd service running on defaults.

I changed the config file, /etc/dhcpcd.conf, by adding some of my own options to the end (here’s man dhcpcd.conf for anyone interested):

# the rest of the options are above
ipv4only
noipv6
nodhcp6

Then restart the service: sudo service dhcpcd restart.  Cleaner logs since then.

PS: I was paranoid with the options. I'm sure with just one of them would have been enough but I don't have the patience to test them one by one. Comment me if you find out which one it is.

  • 1
    Setting only noipv6 worked for me. – Rwky Mar 17 '18 at 11:49
  • Well, disabling ipv6 is not what the asker needed. I don't think we should keep cutting all attempts to introduce IPv6, dudes. We ran out of IPv4 addresses! – Raúl Salinas-Monteagudo Oct 26 '18 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.