ASL-ASL VPN with dynamic IPs on both ends works

Got it running  

You need:
dyndns or no-ip account for both ends
dynip-updateclient configured and working on both ends 
(we use no-ip-client compiled with pluspack on a 3.2 ASL)
nslookup from tools.tgz
faith


configure your VPN on both ASL with actual IPs
as 'standard'. Use PSK for testing.

create a script in /usr/local/sbin

#!/bin/bash
# yes, it is really ugly :-)
cp /etc/wfe/conf/netdata /tmp/
nslookup  | grep Address | cut -d : -f 2 | cut -d \ -f 3 > /tmp/your-VPN-partner.txt
sed /127.0.0.1/d /tmp/your-VPN-partner.txt > /tmp/your-VPN-partner1.txt
newip=`cat your-VPN-partner1.txt`
#echo $newip
cat /etc/wfe/conf/netdata | grep your-VPN-partner_red | cut -d \# -f 3 > /tmp/compare.txt
sed /your-VPN-partner_red/d /tmp/netdata > /tmp/netdata1 && \
line1='X#your-VPN-partner_red#' && \
line2='#255.255.255.255#V' && \
line3=$line1$newip$line2 && \
echo $line3 >> /tmp/netdata1 && \
diff your-VPN-partner1.txt compare.txt || \
cp /tmp/netdata1 /etc/wfe/conf/netdata && \
chmod 644 /etc/wfe/conf/netdata && \
chown wwwrun.nogroup /etc/wfe/conf/netdata


don't forget to chmod it executable and call this script by cron every 5 minutes

when you touch netdata, mdw reconfigures your connections.

have fun,

Erik
  
Parents
  • could you give more explanation please. i dont got it working. ive installed tools.tgz on both astaros. both ends are dynamic. ive created a script called dynscript on both ends and put the lines below in both of the files.

    #!/bin/bash
    cp /etc/wfe/conf/netdata /tmp/
    nslookup  | grep Address | cut -d : -f 2 | cut -d \ -f 3 > /tmp/your-VPN-partner.txt
    sed /127.0.0.1/d /tmp/your-VPN-partner.txt > /tmp/your-VPN-partner1.txt
    newip=`cat your-VPN-partner1.txt`
    #echo $newip
    cat /etc/wfe/conf/netdata | grep your-VPN-partner_red | cut -d \# -f 3 > /tmp/compare.txt
    sed /your-VPN-partner_red/d /tmp/netdata > /tmp/netdata1 && \
    line1='X#your-VPN-partner_red#' && \
    line2='#255.255.255.255#V' && \
    line3=$line1$newip$line2 && \
    echo $line3 >> /tmp/netdata1 && \
    diff your-VPN-partner1.txt compare.txt || \
    cp /tmp/netdata1 /etc/wfe/conf/netdata && \
    chmod 644 /etc/wfe/conf/netdata && \
    chown wwwrun.nogroup /etc/wfe/conf/netdata

    i made both files executable. what next...  
  • Good one j!

    In response to orhan, run it interactively or try sticking

    exec 1>>log_path 
    exec 2>>log_path 

    at the top of the script; this will capture errors to a file for your review...

    Did you load it in  cron  like the man said? [click on the cron link here]

    uncue: he said the nslookup from tools; that does not mean you have to load the entirety of tools. Extract the nslookup, run it interactively to see if it needs any libraries, go back and add those; done...

    This script could be enhanced to substitute name lookups on any network definition name containing an embedded dot (such as gateway.friend.comgateway.branch-office.com, or mail-relay.isp.net). So now your firewall rules could work dynamically too. Preferable to use statics from a security standpoint, but for those situations where you have to support it. Does anybody know if the DynDNS posted at Astaro.org supports DNSSEC??
  • Re: DNSSEC; got it;

    the nslookup could be replaced with dig (I loaded it on mine from RedHat 8, +requisite libraries). ezipupdate does not appear to support DNSSEC, but nsupdate from another distro will...
      
  • [ QUOTE ]
    uncue: he said the nslookup from tools; that does not mean you have to load the entirety of tools. Extract the nslookup, run it interactively to see if it needs any libraries, go back and add those; done...

     

    [/ QUOTE ]

    ahh... gotcha.  I thought it was all or nothing.  my bad.  
  • Sorry if I sounded curt; it's just typing laziness...
      
  • nah it's cool.      I should have read up or at least read more closely before assuming.  

    I assume if you wanted to compile something, you could do it on a lab box and the copy the binaries over to your production box?  
Reply Children
  • Yeah; though, frankly, I find that I can save myself the trouble of compilation since many RedHat 8 binaries run by putting them through their paces and seeing what libraries they need. It is conceivable that there still might be some call to an oddball library that you could later encounter in the binary that your dry run did not reproduce. I seem to remember that there is a utility that examines the binary and tells you all the libraries it will need. Anybody? If Tom K. (toolkit manager) sees a problem with this, let us know...

       
  • so is it safe to assume that ASL is based off of RH8? 
  • State Secret;
    Hit men will come after us if we discuss that
    (look at the SCO debacle!!)

    [It appears to use a lot of RH conventions, but they part ways with RedHat in various areas because some things RedHat does is stoopid with regards to security; but then many of RedHat's customers demand more flexibility, so they have to sacrifice security in the process; different needs, different distros...]

    They're very careful to play by the rules:
    both OpenSource and Intellectual Property.

    Maybe someday we can have a more open discussion about this, but let's not leave any bannana peels lying around right now for the many "slip and fall" con artists to take advantage of (hopefully they will be a passing fad...). And by 'con artists', I am not referring to the any of the hard working developers and manufacturers of great software, but the get-rich-quick middlemen who can sometimes get accidentally mixed into the process...

    P.S. Many Linux distro binaries will work on other brands of distros, but that does not imply what you are supposing. The reason I mentioned RedHat 8 is because that is what many people in the States happen to have around their shop, and it's convenient (I'm not going to waste everybody's time telling them about how great the binaries work for some obscure distro!). Other posters might give us the heads up that SUSE or Debians work fine too...