Hi,
I ran into problems with mtu sizes on interfaces (gif in my case) and
ospfd. mtu was not the same on both sites so adjacency could not be
formed. The mtu mismatch is also logged by ospfd.
Just changing the MTU with ifconfig is not enough in such a case. I did
not want to restart ospfd since that produces an outage. What I did:
* ifconfig gif1 down
* vi /etc/ospfd.conf -> remove gif1
* ospfctl reload
* ifconfig gif1 mtu 1380 up
* vi /etc/ospfd.conf -> add gif1
* ospfctl reload
To make this a bit easier I propose the below two patches.
The first displays the mtu currently known by ospd with ospfctl. Eg:
-----
remi@mistral:~% doas /usr/src/usr.sbin/ospfctl/obj/ospfctl sho int iwm0
Interface iwm0, line protocol is UP
Internet address 172.18.35.224/24, Area 0.0.0.0
Linkstate active, MTU 1500
^^^^^^^^
Router ID 10.10.10.1, network type BROADCAST, cost: 10
Transmit delay is 1 sec(s), state DR, priority 1
Designated Router (ID) 10.10.10.1, interface address 172.18.35.224
Backup Designated Router (ID) 0.0.0.0, interface address 0.0.0.0
Timer intervals configured, hello 10, dead 40, wait 40, retransmit 5
Hello timer due in 00:00:06+345msec
Uptime 00:00:44
Neighbor count is 0, adjacent neighbor count is 0
-----
The second patch allows ospfd to learn about a changed mtu value (or other
interface configs) with a "ospfctl reload".
Would it be better if an mtu change generates a route message that is
picked up by ospfd the same way as other changes to interfaces configs?
Remi
Index: usr.sbin/ospfctl/ospfctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfctl/ospfctl.c,v
retrieving revision 1.63
diff -u -p -r1.63 ospfctl.c
--- usr.sbin/ospfctl/ospfctl.c 3 Dec 2015 11:42:14 -0000 1.63
+++ usr.sbin/ospfctl/ospfctl.c 25 Nov 2016 16:26:48 -0000
@@ -434,8 +434,9 @@ show_interface_detail_msg(struct imsg *i
inet_ntoa(iface->addr),
mask2prefixlen(iface->mask.s_addr));
printf("Area %s\n", inet_ntoa(iface->area));
- printf(" Linkstate %s\n",
+ printf(" Linkstate %s,",
get_linkstate(iface->if_type, iface->linkstate));
+ printf(" MTU %d\n", iface->mtu);
printf(" Router ID %s, network type %s, cost: %d\n",
inet_ntoa(iface->rtr_id),
if_type_name(iface->type), iface->metric);
Index: usr.sbin/ospfd/ospfd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v
retrieving revision 1.93
diff -u -p -r1.93 ospfd.c
--- usr.sbin/ospfd/ospfd.c 28 Sep 2016 14:39:52 -0000 1.93
+++ usr.sbin/ospfd/ospfd.c 25 Nov 2016 16:26:48 -0000
@@ -591,6 +591,8 @@ ospf_reload(void)
struct ospfd_conf *xconf;
struct redistribute *r;
+ kif_init();
+
if ((xconf = parse_config(conffile, ospfd_conf->opts)) == NULL)
return (-1);