Page 22 of 22

PHP4 IPv6 validation

Incase you don’t have the luxury of PHP5’s filter_ functions, this is a handy regexp:

function validate_ipv6($ip)
$hex = ‘[A-Fa-f0-9]’;
$h16 = “{$hex}{1,4}”;
$dec_octet = ‘(?:25[0-5]|2[0-4]d|1dd|[1-9]d|[0-9])’;
$ipv4 = “$dec_octet.$dec_octet.$dec_octet.$dec_octet”;
$ls32 = “(?:$h16:$h16|$ipv4)”;
$ipv6 = “(?:(?:{$IPv4address})|(?:”.
“(?:$h16:){6}$ls32” .
“|::(?:$h16:){5}$ls32” .
“|(?:$h16)?::(?:$h16:){4}$ls32” .
“|(?:(?:$h16:){0,1}$h16)?::(?:$h16:){3}$ls32” .
“|(?:(?:$h16:){0,2}$h16)?::(?:$h16:){2}$ls32” .
“|(?:(?:$h16:){0,3}$h16)?::(?:$h16:){1}$ls32” .
“|(?:(?:$h16:){0,4}$h16)?::$ls32” .
“|(?:(?:$h16:){0,5}$h16)?::$h16” .
“|(?:(?:$h16:){0,6}$h16)?::” .

$regex = “/^$ipv6$/”;
return preg_match($regex, $ip);

Read more

Using this site.

Yes, you read right. Instead of using this domain just for email and my servers, I am going to use this site. Probaly just going to be handy articles (for myself), backend scripts, pictures and some time-wasting games.

I have too many separate systems (dns, backups, monitoring, etc), of which I was sick of a week ago. It’s a wonderful mesh of it all.

Read more

%CRYPTO-4-PKT_REPLAY_ERR: decrypt: replay check failed connection id=xxx

If your replay window size has not been set to a number that is high enough for the number of packets received, you will receive a system message such as the following:

*Nov 17 19:27:32.279: %CRYPTO-4-PKT_REPLAY_ERR: decrypt: replay check failed connection id=xxx

To prevent this error, you can do following:

rtr(config)# crypto ipsec security-association replay window-size 1024

Read more

rtsol under Leopard

Leopard’s rtsol clients seems broken. Thanks to Wiedi, I managed to create this patch:

Read more

© 2018 Lostdomain

Theme by Anders NorénUp ↑