[SR-Users] nat_uac_test(8)

Daniel Tryba d.tryba at pocos.nl
Fri Mar 23 10:43:05 CET 2018


On Thu, Mar 22, 2018 at 04:23:18PM -0400, John Petrini wrote:
> If you're asking if nat_uac_test should be updated to check for 192.0.0.0/29
> I think that's a great idea.

Don't know if I got every use in the source tree of private nets, but
following diff should do the trick. This net can be used for ip4<->ipv6<->ipv4 
NAT translations. So 6TO4-RELAY in ipops fits better than PRIVATE. But is simply 
indicates NAT transversal for the nathelper module.

I'm to lazy^W^Wdon't have the time to figure out how to do the
appropriate git magic.

diff --git a/src/modules/ipops/detailed_ip_type.c b/src/modules/ipops/detailed_ip_type.c
index a37c4aacc..529645e99 100644
--- a/src/modules/ipops/detailed_ip_type.c
+++ b/src/modules/ipops/detailed_ip_type.c
@@ -41,6 +41,7 @@ static ip4_node IPv4ranges[IPv4RANGES_SIZE] = {
         { 0xc0586300,  "6TO4-RELAY", 0xffffff00 },  // 192.88.99.0/24
         { 0xc0000200,  "TEST-NET",   0xffffff00 },  // 192.0.2/24
         { 0xc0000000,  "RESERVED",   0xffffff00 },  // 192.0.0/24
+        { 0xc0000000,  "6TO4-RELAY", 0xfffffff8 },  // 192.0.0.0/29
         { 0xc0a80000,  "PRIVATE",    0xffff0000 },  // 192.168/16
         { 0xa9fe0000,  "LINK-LOCAL", 0xffff0000 },  // 169.254/16
         { 0xc6120000,  "RESERVED",   0xfffe0000 },  // 198.18/15
diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c
index ead4c696f..710d281f5 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -258,6 +258,7 @@ static NetInfo rfc1918nets[] = {
        {"172.16.0.0", 0xac100000UL, 0xfff00000UL},
        {"192.168.0.0", 0xc0a80000UL, 0xffff0000UL},
        {"100.64.0.0", 0x64400000UL, 0xffc00000UL}, // include rfc6598 shared address space as technically the same for our purpose
+       {"192.0.0.0", 0xc0000000UL, 0xfffffff8UL}, // include rfc7335 IPv4 Service Continuity Prefix
        {NULL, 0UL, 0UL}
 };
 
@@ -2156,4 +2157,4 @@ int mod_register(char *path, int *dlflags, void *p1, void *p2)
 {
        sr_kemi_modules_add(sr_kemi_nat_traversal_exports);
        return 0;
-}
\ No newline at end of file
+}
diff --git a/src/modules/nathelper/nathelper.c b/src/modules/nathelper/nathelper.c
index a45588a50..935c981ee 100644
--- a/src/modules/nathelper/nathelper.c
+++ b/src/modules/nathelper/nathelper.c
@@ -148,6 +148,7 @@ static struct {
        {"172.16.0.0",  0, 0xffffffffu << 20},
        {"192.168.0.0", 0, 0xffffffffu << 16},
        {"100.64.0.0",  0, 0xffffffffu << 22}, /* rfc6598 - cg-nat */
+       {"192.0.0.0",   0, 0xffffffffu <<  3}, /* rfc7335 - IPv4 Service Continuity Prefix */
        {NULL, 0, 0}
 };
 /* clang-format on */




More information about the sr-users mailing list