Quantcast
Viewing all articles
Browse latest Browse all 60861

Re: DDNS and Hairpin NAT

Did some more digging and this has been mentioned before. Too bad it has not been resolved internally by now.

 

This is a link that describes adding a script "dynnat" to the  "/config/scripts" directory.

 

<https://blog.laslabs.com/2013/06/nat-reflection-ubiquiti-edgerouter-lite-vyatta-and-dynamic-ip/>

 

#!/bin/vbash
IP=`curl -s icanhazip.com`
source /opt/vyatta/etc/functions/script-template
configure

for RULE_NUM in `show service nat | grep rule | tr -d '{' | sed 's/rule\|\s//g'`;
do
    RES=\"`show service nat rule $RULE_NUM`\"
    echo $RES
    if echo $RES | grep -q '+';
        then
            set service nat rule $RULE_NUM destination address $IP
    fi
done
commit
save

 


Viewing all articles
Browse latest Browse all 60861

Trending Articles