"Discover Interfaces" not working | FWCloud Forum

"Discover Interfaces" not working

pengels

New member
Hello! I'm trying to get the "Discover Interfaces" tool working. I provided the correct address and username and password, and I can verify that a session was opened for that user. Does the user need to be an admin? Does this depend on networkmanager? Right now, my machine is configured statically via /etc/sysconfig/network-scripts/ifcfg-eth0 and etc. Is that incompatible with the discover interfaces tool? CentOS 7.9.2009

1619621374376.png
 

Carles Munyoz

Administrator
Staff member
Hello,
The discover interfaces feature executes the command ip a in the destination host.
Please, may you run this command in your machine and post here the output ?
 

pengels

New member
Code:
root@mysystem ~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever

Note that the IP and MAC have been changed for privacy reasons.
 

Carles Munyoz

Administrator
Staff member
Have you executed the ip a command with the same user that you use in the FWCloud discover interfaces tool ?

Can you post the log lines that are appended to the /opt/fwcloud/api/log/app.log file after executing the discover interfaces tool ?
 

pengels

New member
Yup! Sameip a result with the user am connecting as.

The only line that results from trying the discovery is this:

Code:
2021-04-28 11:30:13|ERROR|Error getting network interface information: {}
 

pengels

New member
It worked running as root, though. I DEFINITELY don't want to use the root account for this sort of thing. Do you know what commands the UI is sending along the SSH session?
 

Carles Munyoz

Administrator
Staff member
When you use a user different from root, the command is: sudo ip a
I think that the problem is that you have used a user without password.

Please, may you try it again with a user with sudo privileges and with password ?
 

pengels

New member
I've verified that sudo ip a works with the user and that the user can log in to the system.

Code:
fwclouduserthing@mysystem's password:
Last login: Wed Apr 28 12:27:29 2021 from myothersystem
[fwclouduserthing@mysystem ~]$ sudo ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever

Same entry in the log file:
2021-04-28 12:28:41|ERROR|Error getting network interface information: {}
 

pengels

New member
I've added a sudo rule that allows any command with "sudo ip" such as "sudo ip a" or "sudo ip addr sh". I've also tried using an LDAP user instead of a local user without any luck. Thank you for all your patience so far.
 

pengels

New member
Code:
[pengels@myothersystem]~% ssh fwcloudapi@mysystem sudo /sbin/ip address show

fwcloudapi@mysystem's password:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
[pengels@mysystem]~%
 

Carles Munyoz

Administrator
Staff member
If the process goes fine with the root user, then the problem is not in the ip a command output.
It must be in the sudo process for execute commands with root privileges.

If you log into your server with the fwcloudapi user, and then run: sudo ip a
Are you required to you insert again the password of the fwcloudapi user ?

If not, the problem is here.
We require a sudo user that must enter its password when executes commands with sudo.

As additional information, I have just tested the FWCloud discover interfaces tool with a Centos 8 server using a sudo privileges user and all has gone fine.
 

pengels

New member
Previously I had sudo run with no password, but requiring a password for sudo didn't help.

Code:
~ » ssh fwcloudapi@mysytem
fwcloudapi@mysytem's password:
Last login: Wed Apr 28 13:13:04 2021 from myothersytem
[fwcloudapi@mysytem ~]$ sudo ip a
[sudo] password for fwcloudapi:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
[fwcloudapi@mysystem ~]$
 

Carles Munyoz

Administrator
Staff member
Your are welcome! :)
Don't worry, the matter is to find where is the problem but is complicated because I'm not able to reproduce it.

The sudo ip a output is as expected, then the problems should not be here.

If I give you a fixed source IP, would be possible to connect to your server by means of ssh in order to try to reproduce the problem ?
Do you use PGP ? If yes, I can send you muy public key, this way you can securely supply me the user and password for ssh access.

If you don't want to supply such access, no problem, I understand.
 

pengels

New member
I might be on to something:

Code:
root@myothersystem ~ $ ssh fwcloudapi@mysystem sudo ip address show
fwcloudapi@mysystem's password:
sudo: no tty present and no askpass program specified

This error was not present until I enabled asking for password with the sudo command. It wouldn't have bugged out like this with the nopasswd option set.
 

pengels

New member
The -t flag works when I do it manually, but I am unsure how to configure that within FWCloud.

Code:
root@myothersystem ~ $ ssh -t fwcloudapi@mysystem sudo ip address show
fwcloudapi@mysystem's password:
[sudo] password for fwcloudapi:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever
Connection to mysystem closed.
 
Top