leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Static ipv4 problem

Sun Jan 12, 2014 12:27 pm

Good Sunday to all, I started this post because I have a problem with my internet site. Unfortunately I have an internet line that is very unstable and often does not work. when it does not work, the ip address of my home router changes. when the internet is up and running, it changed the ip of the server, so the service no-ip can not find the new address so the website is wrong. is there a way to always keep the same ip? (I have already set the static ip in raspberry).

I hope you understand what I wrote (my english is bad)
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

lazarus78
Posts: 236
Joined: Thu Jul 25, 2013 5:16 pm

Re: Static ipv4 problem

Mon Jan 13, 2014 5:39 pm

The only way for your external IP to be static is to contact your ISP and request it. Static IPs usually cost more (Given the dwindeling number of IPv4 addresses), so you better contact them about your stability issues.

leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Re: Static ipv4 problem

Mon Jan 13, 2014 6:59 pm

Thank you for your response. So there is no other solution to make sure that the ip address marked on no-ip change automatically when the connection is restored? :?:
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

gdt
Posts: 85
Joined: Thu Jul 19, 2012 10:19 am

Re: Static ipv4 problem

Tue Jan 14, 2014 3:54 am

An alternative is to accept that your IP address will change.

Then use an external Dynamic DNS server to hold a static DNS name which resolves to the current address. External users will then refer to your services by DNS name.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Static ipv4 problem

Tue Jan 14, 2014 8:19 pm

Hello,

I haven't used no-ip for several years and then it was on a Windows machine, but I seem to remember that there is a small program on your machine that automatically sends your ip address to no-ip. I can't remember if it runs at set intervals or just on startup.

You could write a script that tests if your ip address has changed, and if it has changed, call the no-ip program, which will update their servers with your new address. Use crontab to run your script, say every 5 minutes.

Regards

anita2R

User avatar
DougieLawson
Posts: 36528
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Static ipv4 problem

Tue Jan 14, 2014 9:20 pm

NO-IP supplies a Linux script that will run on your RPi.

sudo apt-get install noip2
Or build from source: http://www.noip.com/support/knowledgeba ... te-client/
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Re: Static ipv4 problem

Wed Jan 15, 2014 4:55 pm

In fact, I had already installed on my noip2 raspberry pi and is still active, but the ip keeps changing. :|
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Static ipv4 problem

Wed Jan 15, 2014 6:03 pm

Hi,

If you have noip2 installed, then the next question is whether it is configured correctly.

What have you set the update interval to ?
Is noip2 pointed to the correct domain name - <yourname>.noip.com
Have you got the correct username and password set.

Look at http://manpages.ubuntu.com/manpages/pre ... ip2.8.html

I noticed that the outgoing communication uses port 8245 - is this open

Regards

anita2R

leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Re: Static ipv4 problem

Wed Jan 15, 2014 7:59 pm

you were right it was remained the old configuration of the old host. how do I set the new one?
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

User avatar
DougieLawson
Posts: 36528
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Static ipv4 problem

Wed Jan 15, 2014 9:44 pm

leofabri wrote:you were right it was remained the old configuration of the old host. how do I set the new one?
How often does your ISP change your IP address, how long is the lease?
Find that time, divide by 2 and set that as the noip2 script timer.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Static ipv4 problem

Wed Jan 15, 2014 9:48 pm

Hi,

I don't have noip2 so I can't walk you through the configuration.

However, from noip's web site http://www.noip.com/support/knowledgeba ... on-ubuntu/ it says the following (for ubuntu), but I think that it will also work for raspbian:
To Configure the Client:
As root again (or with sudo) issue the below command:
/usr/local/bin/noip2 -C (dash capital C, this will create the default config file)

You will then be prompted for your username and password for No-IP, as well as which host names you wish to update. Be careful, one of the questions is “Do you wish to update all hosts”. If answered incorrectly this could effect host names in your account that are pointing at other locations.

Now the client is installed and configured, you just need to launch it. Simply issue this final command to launch the client in the background:

/usr/local/bin/noip2
This should create a file:
/var/lib/noip2/noip2.conf

If you need to change anything else later on you can probably do it by editing the configuration file - noip2.conf

Regards

anita2R

leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Re: Static ipv4 problem

Sat Jan 18, 2014 2:38 pm

Thank you all for your responses. unfortunately I was not able to reply to your messages I have been very busy.
About noip2, when I try to run the command to reconfigure the host I get the following error:

Code: Select all

sudo usr/local/bin/noip2 -C

Configuration file '/usr/local/etc/no-ip2.conf' is in use by process 3113.
Ending!
What could it be? :?:
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Static ipv4 problem

Sat Jan 18, 2014 3:40 pm

Hi,

It's probably the noip2 process which is already running.

Run your command again - get the process id number - just in-case it's changed from 3113
Then enter lsof | grep 3113 or whatever the id number is
This should show a line with a process path/name
If it shows noip2, then just kill the process
Enter kill 3113 or whatever the id number is

Now try your setup again

When happy with the setup, restart noip2

Regards

anita2R

leofabri
Posts: 40
Joined: Fri Nov 01, 2013 8:51 am
Location: italy
Contact: Website

Re: Static ipv4 problem

Sat Jan 18, 2014 8:40 pm

Guys, I have a much more serious problem. I do not know how it happened, but for the past hour, the server no longer works, I get the message "Error establishin database connection" and I do not know how to fix it. I looked at the apache error log and here is what it says:

Code: Select all

[Sat Jan 18 20:11:52 2014] [error] [client 173.245.49.69] WordPress database error Lost connection to MySQL server during query for query UPDATE `wp_options` SET `option_value` = '1390072292.3099479675292968750000' WHERE `option_name` = '_transient_doing_cron' made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_cron, spawn_cron, set_transient, update_option
[Sat Jan 18 20:11:52 2014] [error] [client 173.245.49.69] WordPress database error Lost connection to MySQL server during query for query SELECT option_value FROM wp_options WHERE option_name = 'wps_exclude_ip' LIMIT 1 made by shutdown_action_hook, do_action('shutdown'), call_user_func_array, wp_statistics_shutdown_action, Hits->__construct, get_option
[Sat Jan 18 20:11:52 2014] [error] [client 173.245.49.69] WordPress database error Lost connection to MySQL server during query for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, lrss_init, get_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error Lost connection to MySQL server during query for query UPDATE `wp_options` SET `option_value` = '1390072292.3194820880889892578125' WHERE `option_name` = '_transient_doing_cron' made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, wp_cron, spawn_cron, set_transient, update_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error Lost connection to MySQL server during query for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, lrss_init, get_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error MySQL server has gone away for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, lrss_init, get_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error MySQL server has gone away for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode-msqld' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WPMaintenanceMode->on_init, WPMaintenanceMode::get_msqld_option, get_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error MySQL server has gone away for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode-msqld' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, WPMaintenanceMode->on_init, WPMaintenanceMode::get_msqld_option, get_option
[Sat Jan 18 20:11:53 2014] [error] [client 173.245.49.69] WordPress database error MySQL server has gone away for query SELECT option_value FROM wp_options WHERE option_name = 'wp-maintenance-mode-msqld' LIMIT 1 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
[Sat Jan 18 21:19:51 2014] [error] [client 108.162.221.155] File does not exist: /var/www/wordpress
[Sat Jan 18 21:19:56 2014] [error] [client 108.162.231.142] File does not exist: /var/www/wordpress
[Sat Jan 18 21:19:57 2014] [error] [client 108.162.231.142] File does not exist: /var/www/wordpress
[Sat Jan 18 21:20:21 2014] [error] [client 192.168.1.189] File does not exist: /var/www/currentsetting.htm
[Sat Jan 18 21:21:28 2014] [error] [client 192.168.1.189] File does not exist: /var/www/favicon.ico
[Sat Jan 18 21:24:31 2014] [error] [client 192.168.1.189] File does not exist: /var/www/currentsetting.htm
[Sat Jan 18 21:24:50 2014] [error] [client 108.162.221.155] File does not exist: /var/www/wordpress
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
[Sat Jan 18 21:29:26 2014] [error] [client 192.168.1.189] File does not exist: /var/www/currentsetting.htm
[Sat Jan 18 21:29:57 2014] [error] [client 108.162.221.155] File does not exist: /var/www/wordpress
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
PHP:  syntax error, unexpected '(' in /etc/php5/apache2/conf.d/20-apc.ini on line 4
[Sat Jan 18 21:34:21 2014] [error] [client 192.168.1.189] File does not exist: /var/www/currentsetting.htm
[Sat Jan 18 21:34:53 2014] [error] [client 108.162.221.155] File does not exist: /var/www/wordpress
I need help, I do not know how to fix it and I have a fairly recent system backup. help :( :cry:

I tried to access mysql via phpmyadmin it tells me "Error # 2002 Can not log in to the MySQL server, Connection for controluser as defined in your configuration failed." what's the problem? :?:
HDroid, the first Android website on the smallest server in the world. :-)
www.hdroidblog.net

Return to “Networking and servers”