Bug 1256312 - The facts option picks a wrong network interface
The facts option picks a wrong network interface
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: candlepin-bugs
John Sefler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-24 06:59 EDT by xingge
Modified: 2016-09-19 22:28 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-11 04:43:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description xingge 2015-08-24 06:59:40 EDT
Description of problem:
The facts option picks a wrong network interface

Version-Release number of selected component (if applicable):
subscription-manager-gui-1.15.9-6.el7.x86_64
subscription-manager-1.15.9-6.el7.x86_64
subscription-manager-initial-setup-addon-1.15.9-6.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1.list the system's network inter face
[root@dhcp-128-252 ~]# ifconfig
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 <------should be picked by the facts option 
        inet 10.66.129.236  netmask 255.255.254.0  broadcast 10.66.129.255
        inet6 fe80::5054:ff:fe5d:abd  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:5d:0a:bd  txqueuelen 1000  (Ethernet)
        RX packets 56631  bytes 4316546 (4.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2206  bytes 723292 (706.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 72  bytes 6720 (6.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 72  bytes 6720 (6.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:65:1f:26  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2.use facts option to list the system's network
[root@dhcp-128-252 ~]# subscription-manager facts | grep network
network.hostname: dhcp-128-252.nay.redhat.com
network.ipv4_address: 127.0.0.1       <--------------wrong interface picked
network.ipv6_address: ::1       <------------------also wrong interface

Actual results:
As the step2 shows 

Expected results:
The facts option should pick ens3's ip address not the lo's.

Additional info:
I think the facts option netwok may kind of unnecessary now cause we have the net option like below:
[root@dhcp-128-252 ~]# subscription-manager facts | grep "net.interface"
net.interface.ens3.ipv4_address: 10.66.129.236
net.interface.ens3.ipv4_broadcast: 10.66.129.255
net.interface.ens3.ipv4_netmask: 23
net.interface.ens3.ipv6_address.link: fe80::5054:ff:fe5d:abd
net.interface.ens3.ipv6_netmask.link: 64
net.interface.ens3.mac_address: 52:54:00:5D:0A:BD
net.interface.lo.ipv4_address: 127.0.0.1
net.interface.lo.ipv4_broadcast: Unknown
net.interface.lo.ipv4_netmask: 8
net.interface.lo.ipv6_address.host: ::1
net.interface.lo.ipv6_netmask.host: 128
net.interface.virbr0-nic.mac_address: 52:54:00:65:1F:26
net.interface.virbr0.ipv4_address: 192.168.122.1
net.interface.virbr0.ipv4_broadcast: 192.168.122.255
net.interface.virbr0.ipv4_netmask: 24
net.interface.virbr0.mac_address: 52:54:00:65:1F:26
Comment 1 Filip Nguyen 2015-09-03 07:16:02 EDT
network.ipv4_address is a result of IP resolution for your hostname, not 'a pick' from the list of interfaces. What is your output for commands:
 sudo cat /etc/hostname
 sudo cat /etc/resolv.conf
 sudo cat /etc/hosts
 sudo cat /etc/sysconfig/network
 hostname
 arp -n $(hostname)
 ping -c 1 $(hostname)
Comment 2 Filip Nguyen 2015-09-11 04:43:07 EDT
Closing this as not a bug.

Note You need to log in before you can comment on or make changes to this bug.