IP Address Detection at CentOS

Support forum for the ViciBox ISO Server Install and ISO LiveCD Demo

Moderators: enjay, williamconley, Staydog, mflorell, MJCoate, mcargile, Kumba

IP Address Detection at CentOS

Postby cavagnaro » Tue Mar 26, 2019 4:59 pm

Hi
I am trying to install Vicidial in a CentOS 7.
Seems that the Ip update script didn't recognize the IP Address by default showing only
Code: Select all
Old server IP address or press enter for default: []

server IP address or press enter for default: []


I changed the perl script to this

Code: Select all
                ##### BEGIN server_ip propmting and check #####
                if (length($VARserver_ip)<7)
                        {
                        ### get best guess of IP address from ifconfig output ###
                        # inet addr:10.10.11.17  Bcast:10.10.255.255  Mask:255.255.0.0
                        @ip = `/sbin/ifconfig`;
                        $j=0;
                        while($#ip>=$j)
                                {
                                if ($ip[$j] =~ /inet/) {$VARserver_ip = $ip[$j]; $j=1000;}
                                $j++;
                                }
                        $VARserver_ip =~ s/.*inet | netmask.*|\r|\n|\t| //gi;
                        }
[code]
as ifconfig output is
[code]
[root@edial1 bin]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
        inet 172.31.7.101  netmask 255.255.240.0  broadcast 172.31.15.255
        inet6 fe80::c2:6aff:fef7:7e14  prefixlen 64  scopeid 0x20<link>
        ether 02:c2:6a:f7:7e:14  txqueuelen 1000  (Ethernet)
        RX packets 107247  bytes 138860198 (132.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 39989  bytes 6299235 (6.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



Hope helps someone if trying to install in another OS
cavagnaro
 
Posts: 38
Joined: Thu Feb 28, 2019 1:39 pm

Re: IP Address Detection at CentOS

Postby williamconley » Tue Mar 26, 2019 8:09 pm

1) Welcome to the Party! 8-)

2) As you are obviously new here, I have some suggestions to help us all help you:

When you post, please post your entire configuration including (but not limited to) your installation method (7.X.X?) and vicidial version with build (VERSION: 2.X-XXXx ... BUILD: #####-####).

This IS a requirement for posting along with reading the stickies (at the top of each forum) and the manager's manual (available on EFLO.net, both free and paid versions)

You should also post: Asterisk version, telephony hardware (model number is helpful here), cluster information if you have one, and whether any other software is installed in the box. If your installation method is "manual/from scratch" you must post your operating system with version (and the .iso version from which you installed your original operating system) plus a link to the installation instructions you used. If your installation is "Hosted" list the site name of the host.

If this is a "Cloud" or "Virtual" server, please note the technology involved along with the version of that techology (ie: VMware Server Version 2.0.2). If it is not, merely stating the Motherboard model # and CPU would be helpful.

Similar to This:

Vicibox X.X from .iso | Vicidial X.X.X-XXX Build XXXXXX-XXXX | Asterisk X.X.X | Single Server | No Digium/Sangoma Hardware | No Extra Software After Installation | Intel DG35EC | Core2Quad Q6600

3) If you want your code to be included, you should create a DIFF against the latest svn trunk and post it in the Vicidial Issue Tracker (link at the top of this page). The Issue Tracker is a separate system from the forum, you'll need to create a login. Then post a link to your issue here in the forum for reference.
Vicidial Installation and Repair, plus Hosting and Colocation
SugarCRM integration - Customization and Add-ons - We Bring It All Together.
http://www.PoundTeam.com # 352-269-0000 # +44 (203) 769-2294 # +506 4001-8914
williamconley
 
Posts: 18984
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: IP Address Detection at CentOS

Postby cavagnaro » Wed Mar 27, 2019 8:09 pm

Hi,
Was not addressing a correction for the current installation method. As I installed in a non supported Linux distro, had to do this modification. Just that.
cavagnaro
 
Posts: 38
Joined: Thu Feb 28, 2019 1:39 pm

Re: IP Address Detection at CentOS

Postby williamconley » Wed Mar 27, 2019 10:43 pm

cavagnaro wrote:Hi,
Was not addressing a correction for the current installation method. As I installed in a non supported Linux distro, had to do this modification. Just that.


Vicidial is OS independent. ifconfig is a standardized linux cli command. thus it could be written to use your method when any other method fails, thus helping everyone if applied to the latest version. AND if it gets updated, next time you won't have to modify the code, it'll just be there already. And you get the warm fuzzy of helping the project. Everybody wins.
Vicidial Installation and Repair, plus Hosting and Colocation
SugarCRM integration - Customization and Add-ons - We Bring It All Together.
http://www.PoundTeam.com # 352-269-0000 # +44 (203) 769-2294 # +506 4001-8914
williamconley
 
Posts: 18984
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: IP Address Detection at CentOS

Postby Kumba » Mon Apr 01, 2019 12:18 pm

Newer distro's don't even include 'ifconfig' as it's considered deprecated in favor of using 'ip' for configuration. The 'route' command is also missing on these distros as all TCP/IP stack manipulation is expected to be done through the 'ip' command as well. It also has some issues properly parsing VLAN configs depending on how the admin or operating system set them up. It's not a show stopped though, just a 'feature' that doesn't work on newer OS'.

The script itself works just fine, you'll just have to type in the IPs it's showing if it's not correct. That means you might have to look in the old astguiclient.conf or on the database to get the old IP address that was used.

For what it's worth, these exist in a package called 'nettools-deprecated' on OpenSuSE v.15.0 and up. I imagine other distro's have it in a similar package name in case anyone is looking for thme.
Kumba
 
Posts: 812
Joined: Tue Oct 16, 2007 11:44 pm
Location: Florida

Re: IP Address Detection at CentOS

Postby cavagnaro » Mon Apr 01, 2019 5:53 pm

Well the Amazon EC2 brings it, difference is the output of the command. Instead of being "inet addr:" it is just "inet" followed by the submask.
cavagnaro
 
Posts: 38
Joined: Thu Feb 28, 2019 1:39 pm

Re: IP Address Detection at CentOS

Postby williamconley » Tue Apr 02, 2019 10:20 am

cavagnaro wrote:Well the Amazon EC2 brings it, difference is the output of the command. Instead of being "inet addr:" it is just "inet" followed by the submask.


good to know. a properly designed regex would accommodate both versions.
Vicidial Installation and Repair, plus Hosting and Colocation
SugarCRM integration - Customization and Add-ons - We Bring It All Together.
http://www.PoundTeam.com # 352-269-0000 # +44 (203) 769-2294 # +506 4001-8914
williamconley
 
Posts: 18984
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to ViciBox Server Install and Demo

Who is online

Users browsing this forum: No registered users and 17 guests