From 0512ffb7f70f85223a71ffd539b74459793178af Mon Sep 17 00:00:00 2001 From: Guillaume Mazoyer Date: Wed, 3 Sep 2014 11:19:56 +0200 Subject: Add config to disallow the use of private and reserved IP ranges. --- includes/config.defaults.php | 13 +++++-- includes/utils.php | 88 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/config.defaults.php b/includes/config.defaults.php index 06fac62..aca58ff 100644 --- a/includes/config.defaults.php +++ b/includes/config.defaults.php @@ -28,7 +28,12 @@ $config = array( // Logs file when commands will be written 'logs' => '/var/log/looking-glass.log', // Allow private ASN - 'allow_private_asn' => false + 'allow_private_asn' => false, + // Allow RFC1918 IPv4 and FD/FC IPv6 as parameters + 'allow_private_ip' => true, + // Allow reserved IPv4 addresses (0.0.0.0/8, 169.254.0.0/16, + // 192.0.2.0/24 and 224.0.0.0/4) + 'allow_reserved_ip' => true ), // Documentation (must be HTML) @@ -37,7 +42,7 @@ $config = array( 'bgp' => array( 'command' => 'show route IP_ADDRESS', 'description' => 'Show the best routes to a given destination.', - 'parameter' => 'The parameter must be a valid destination. Destination means an IPv4/IPv6 address or a subnet. Masks are also accepted as part of a valid IPv4/IPv6 address.
Please note that some routers always need a mask to be given when looking for an IPv6 address.

Example of valid arguments: