Jira (FACT-1932) facter does not pick primary network interface properly on FreeBSD or OpenBSD

0 views
Skip to first unread message

Jim Pirzyk (JIRA)

unread,
Jun 27, 2019, 10:28:03 AM6/27/19
to puppe...@googlegroups.com
Jim Pirzyk created an issue
 
Facter / Bug FACT-1932
facter does not pick primary network interface properly on FreeBSD or OpenBSD
Issue Type: Bug Bug
Affects Versions: FACT 3.14.0
Assignee: Unassigned
Created: 2019/06/27 7:27 AM
Environment:

44>uname -a
FreeBSD $HOST.$DOMAIN 11.2-RELEASE-p10 FreeBSD 11.2-RELEASE-p10 #0: Mon May 13 21:20:50 UTC 2019 ro...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 amd64 amd64 FreeBSD

2>uname -a
OpenBSD $HOST.$DOMAIN 6.4 GENERIC.MP#0 amd64

Priority: Normal Normal
Reporter: Jim Pirzyk

The default primary interface choice on FreeBSD and OpenBSD is the first non localhost interface alphabetically.  This does not really work when a system has more than one interface of differing types.  For example:

33>netstat -i
{{ Name Mtu Network Address Ipkts Ierrs Idrop Opkts Oerrs Coll}}
{{ lo0 16384 <Link#1> lo0 235832 0 0 235832 0 0}}
{{ lo0 - localhost  localhost 71739 - - 73701 - -}}
{{ lo0 - fe80::%lo0/64 fe80::1%lo0 0 - - 0 - -}}
{{ lo0 - your-net localhost 162449 - - 162672 - -}}
{{ xn0 1500 <Link#2> 00:16:3e:64:48:1a 165100162 0 0 35921722 0 0}}
{{ xn0 - $IP $HOST 19261337 - - 33901320 - -}}
{{ xn0 - fe80::%xn0/64 fe80::216:3eff:fe 0 - - 2 - -}}
{{ xn0 - $IPv6 $DOMAIN 2341250 - - 2016716 - -}}
{{ tun0 1500 <Link#3> tun0 575848 0 0 505291 0 0}}
{{ tun0 - fe80::%tun0/6 fe80::216:3eff:fe 0 - - 1 - -}}
{{ tun0 - 192.168.3.0/2 $HOST.vpn.$DOMAIN 575848 - - 505288 - -}}

 

Facter will pick tun0 as the primary interface. 

facterversion => 3.14.0

...

networking => {

...  primary => "tun0"
}

The logic that is used for picking the primary interface on Solaris works here too, just that the netstat -rn columns are different.

on FreeBSD:

34>netstat -rn
Routing tables

Internet:
Destination Gateway Flags Netif Expire
default $ROUTER UGS xn0
127.0.0.1 link#1 UH lo0
$IP_NET.0/24 link#2 U xn0
$IP link#2 UHS lo0
192.168.3.0/29 192.168.3.2 UGS tun0
192.168.3.1 link#3 UHS lo0
192.168.3.2 link#3 UH tun0

Internet6:
Destination Gateway Flags Netif Expire
::/96 ::1 UGRS lo0
default $ROUTER6 UGS xn0
::1 link#1 UH lo0
::ffff:0.0.0.0/96 ::1 UGRS lo0
$IPv6NET::/64 link#2 U xn0
$IPv6 link#2 UHS lo0
fe80::/10 ::1 UGRS lo0
fe80::%lo0/64 link#1 U lo0
fe80::1%lo0 link#1 UHS lo0
fe80::%xn0/64 link#2 U xn0
fe80::216:3eff:fe64:481a%xn0 link#2 UHS lo0
fe80::%tun0/64 link#3 U tun0
fe80::216:3eff:fe64:481a%tun0 link#3 UHS lo0
ff02::/16 ::1 UGRS lo0

and on OpenBSD:

1>netstat -rn
Routing tables

Internet:
Destination Gateway Flags Refs Use Mtu Prio Iface
{{default 192.168.1.1 UGS 4 112689 - 8 em0 }}
{{224/4 127.0.0.1 URS 0 0 32768 8 lo0 }}
{{127/8 127.0.0.1 UGRS 0 0 32768 8 lo0 }}
{{127.0.0.1 127.0.0.1 UHhl 1 2 32768 1 lo0 }}
{{192.168.1/24 192.168.1.2 UCn 2 98177 - 4 em0 }}
{{192.168.1.1 10:0d:7f:ba:8e:c5 UHLch 2 23881 - 3 em0 }}
{{192.168.1.2 00:e0:67:13:5b:a8 UHLl 0 3488 - 1 em0 }}
{{192.168.1.3 00:e0:4d:99:94:b5 UHLc 0 5404 - 3 em0 }}
192.168.1.255 192.168.1.2 UHb 0 783538 - 1 em0

Internet6:
Destination Gateway Flags Refs Use Mtu Prio Iface
{{default fe80::120d:7fff:feba:8ec5%em0 UGS 0 2 - 56 em0 }}
{{::/96 ::1 UGRS 0 0 32768 8 lo0 }}
{{::1 ::1 UHhl 10 20 32768 1 lo0 }}
{{::ffff:0.0.0.0/96 ::1 UGRS 0 0 32768 8 lo0 }}
{{2002::/24 ::1 UGRS 0 0 32768 8 lo0 }}
{{2002:7f00::/24 ::1 UGRS 0 0 32768 8 lo0 }}
{{2002:e000::/20 ::1 UGRS 0 0 32768 8 lo0 }}
{{2002:ff00::/24 ::1 UGRS 0 0 32768 8 lo0 }}
{{$IPv6_NET::/64 $ROUTER6 UCn 1 22 - 4 em0 }}
{{$IPv6 20:c9:d0:2b:1c:ce UHLc 1 30 - 3 em0 }}
{{$IPv6 00:e0:67:13:5b:a8 UHLl 0 463 - 1 em0 }}
{{fe80::/10 ::1 UGRS 0 1 32768 8 lo0 }}
{{fec0::/10 ::1 UGRS 0 0 32768 8 lo0 }}
{{fe80::%em0/64 fe80::c999:2cef:7fd3:25e4%em0 UCn 1 1 - 4 em0 }}
{{fe80::120d:7fff:feba:8ec5%em0 10:0d:7f:ba:8e:c5 UHLch 1 41994 - 3 em0 }}
{{fe80::c999:2cef:7fd3:25e4%em0 00:e0:67:13:5b:a8 UHLl 0 18 - 1 em0 }}
{{fe80::1%lo0 fe80::1%lo0 UHl 0 0 32768 1 lo0 }}
{{ff01::/16 ::1 UGRS 0 1 32768 8 lo0 }}
{{ff01::%em0/32 fe80::c999:2cef:7fd3:25e4%em0 Um 0 1 - 4 em0 }}
{{ff01::%lo0/32 fe80::1%lo0 Um 0 1 32768 4 lo0 }}
{{ff02::/16 ::1 UGRS 0 1 32768 8 lo0 }}
{{ff02::%em0/32 fe80::c999:2cef:7fd3:25e4%em0 Um 0 9 - 4 em0 }}
ff02::%lo0/32 fe80::1%lo0 Um 0 1 32768 4 lo0

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Romain Tartière

unread,
Jun 27, 2019, 12:37:03 PM6/27/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Jul 2, 2019, 9:39:03 AM7/2/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Jul 2, 2019, 9:39:04 AM7/2/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Jul 3, 2019, 5:38:03 AM7/3/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Jul 3, 2019, 5:38:03 AM7/3/19
to puppe...@googlegroups.com

Gabriel Nagy (JIRA)

unread,
Jul 5, 2019, 4:23:03 AM7/5/19
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug FACT-1932
 
Re: facter does not pick primary network interface properly on FreeBSD or OpenBSD

Hi Jim Pirzyk, as Romain Tartière mentioned, this should be fixed in 3.14.1.
Can you verify this?

Thanks!

Gabriel Nagy (JIRA)

unread,
Jul 5, 2019, 4:23:03 AM7/5/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages