Author |
Message |
neralex
Site Admin
![](modules/Forums/images/avatars/201442295664a46e4575d46.jpg)
Joined: Aug 22, 2007
Posts: 1775
|
Posted:
Tue Aug 06, 2013 2:44 am |
|
My ISP has switched for some days my internet connection from ipv4 to the new ipv6. Since then, on some pages I have the problem that my IP is no longer recognized.
Code:You have attempted to access this site with an invalid IP.
Be SURE to include the following information in any email!
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20100101 Firefox/22.0
Remote Address: none
Client IP: none
Forwarded For: none
|
I have found here in the forums some old threads about this issue with ipv6:
http://www.ravenphpscripts.com/postp154750.html#154750
Is it true that a server that was converted to ipv6 recognizes only this format and no longer the ipv4? My own server runs with ipv4 (ipv6 is disabled) and there i get for sure a ipv4 result with $_SERVER['REMOTE_ADDR']. But on a other server is ipv6 enabled there i get only my ipv6 ip but the sentinel blocks there my connection with a "invalid IP" warning.
So now is my question, is it really an issue of the Sentinel and if yes, how i can fix it? |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
wHiTeHaT
Life Cycles Becoming CPU Cycles
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Jul 18, 2004
Posts: 579
|
Posted:
Wed Aug 07, 2013 2:46 pm |
|
I admit i never investigated, but if sentinel makes a problem of the ipv6 address , then sentinel checks the ipv4 address in a particular string, what at the end makes sense it gives a failure with the ipv6 address.
It is also true when a server is fully configured to ipv6, it will give trouble to the client.
Read: http://cr.yp.to/djbdns/ipv6mess.html
But from what i have seen and hear, i understood that most servers and clients support both.
I'm sure you came across the line: ipv6 ready , sometimes.
It isn't an answer to your question.
But i support the idea of let it investigate. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 07, 2013 4:44 pm |
|
My own experience: If you have a client connection based on IPV6 and the server is configured to IPV6, then the server returns everytime the IPV6 format if you set an echo on $_SERVER['REMOTE_ADDR']. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sat Aug 17, 2013 9:45 am |
|
neralex, you could try replace these line in nukesentinel.php (lines 53-61)
Code:
if(!preg_match(REGEX_IPV4, $nsnst_const['server_ip'])) { $nsnst_const['server_ip'] = 'none'; }
$nsnst_const['client_ip'] = get_client_ip();
if(!preg_match(REGEX_IPV4, $nsnst_const['client_ip'])) { $nsnst_const['client_ip'] = 'none'; }
$nsnst_const['forward_ip'] = get_x_forwarded();
if(!preg_match(REGEX_IPV4, $nsnst_const['forward_ip'])) { $nsnst_const['forward_ip'] = 'none'; }
$nsnst_const['remote_addr'] = get_remote_addr();
if(!preg_match(REGEX_IPV4, $nsnst_const['remote_addr'])) { $nsnst_const['remote_addr'] = 'none'; }
$nsnst_const['remote_ip'] = get_ip();
if(!preg_match(REGEX_IPV4, $nsnst_const['remote_ip'])) { $nsnst_const['remote_ip'] = "none"; }
|
With this:
Code:
if (!filter_var($nsnst_const['server_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['server_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['server_ip'] = 'none'; }
$nsnst_const['client_ip'] = get_client_ip();
if (!filter_var($nsnst_const['client_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['client_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['client_ip'] = 'none'; }
$nsnst_const['forward_ip'] = get_x_forwarded();
if (!filter_var($nsnst_const['forward_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['forward_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['forward_ip'] = 'none'; }
$nsnst_const['remote_addr'] = get_remote_addr();
if (!filter_var($nsnst_const['remote_addr'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['remote_addr'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['remote_addr'] = 'none'; }
$nsnst_const['remote_ip'] = get_ip();
if (!filter_var($nsnst_const['remote_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) || !filter_var($nsnst_const['remote_ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { $nsnst_const['remote_ip'] = "none"; }
|
I did not test this as I do not have the proper environment. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Aug 26, 2013 3:22 pm |
|
Thanks. I will check it in the next days with a fresh install of RN251. |
Last edited by neralex on Wed Aug 28, 2013 7:20 am; edited 1 time in total |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm
![](modules/Forums/images/avatars/5ed231554a8492e2e09da.gif)
Joined: Aug 13, 2009
Posts: 1123
|
Posted:
Tue Aug 27, 2013 5:39 am |
|
Sorry but this trick do not work Palbin. I got this message
Code:Be SURE to include the following information in any email!
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:23.0) Gecko/20100101 Firefox/23.0
Remote Address: none
Client IP: none
Forwarded For: none
PLEASE: bear in mind that even if you have done nothing wrong, you may be getting this page due to someone's misuse of the site in your ip range
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
neralex
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Aug 28, 2013 7:20 am |
|
hicuxunicorniobestbuildpc, do you have a ipv6 ip from your ISP and runs your server with ipv6? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hicuxunicorniobestbuildpc
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Aug 29, 2013 7:59 am |
|
I guess not otherwise I won't be able to get that message right? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|