Temat: HEnet IPv6 a dynamiczne IPv4
Moi drodzy,
Cezary napisal bardzo fajny guide odnosnie IPv6 poprzez Tunnel Broker.
http://eko.one.pl/?p=openwrt-ipv6
Ale co jezeli mamy dynamiczne IPv4 ?
Przy kazdej zmienie trzeba wpisac aktualny adres IP na stronie HE co moze byc wyjatkowo upierdliwe.
Ponizej skrypt, ktory robi to automatycznie za Was (skrypt nie napisany przezemnie ... zmodyfikowalem go na potrzeby OpenWRT)
Instalalcja:
1) Doinstalowujemy potrzebne pakiety
opkg update
opkg install bash curl2) Sciagamy skrypt zmodyfikowany na potrzemy OpenWRT (wybierz jedno zrodlo):
a) IPv4:
wget -q -P /usr/sbin http://nimloth.pl/he-ipv4b) IPv6:
wget -q -P /usr/sbin http://ipv6.nimloth.pl/he-ipv4oraz nadajemy mu odpowiednie atrybuty
chmod 755 /usr/sbin/he-ipv43) Uzupelanimy w pliku /usr/sbin/he-ipv4 nasze dane
a) userID - z glownej strony http://tunnelbroker.net/
b) userPass - musi byc podane zahaszowane.
Uzyskac je mozemy poprzez wykonianie komendy:
echo -n YourPassword | md5sumgdzie YourPassword to twoje haslo do HE.
c) tunnelID - Tunnel ID ze strony informacyjnej o tunelu
d) tunnelName - nazwa tunelu nadana w OpenWRT. Jezeli korzystales z opisu Cezarego to jest to 'henet'
5) Mozna dodac wykonanie skryptu do cron'a http://eko.one.pl/?p=openwrt-cron:
echo "*/15 * * * * /usr/sbin/he-ipv4 >/dev/null 2>&1" >> /etc/crontabs/rootbadz/i do autostartu http://eko.one.pl/?p=openwrt-skrypty#sk … ciesystemu
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
/usr/sbin/he-ipv4 >/dev/null 2>&1
exit 0Informacje o wykonaniu skryptu znajdziemy w logread.
Przykladowy wpis:
a) IP nie uleglo zmianie
Sep 22 20:15:01 OpenWrt cron.info crond[5079]: crond: USER root pid 5108 cmd /usr/sbin/he-ipv4 >/dev/null 2>&1
Sep 22 20:15:01 OpenWrt user.notice root: (he-ipv4.sh) [Info] The external IPv4 address (x.x.x.x) has not changed. Exitingb) IP uleglo zmianie
Sep 22 19:28:55 OpenWrt user.notice root: (he-ipv4) [Warning] "/tmp/he-ipv4.ip" does not exist, attempting to create file
Sep 22 19:28:55 OpenWrt user.notice root: (he-ipv4) [Info] "/tmp/he-ipv4.ip" has successfully been created
Sep 22 19:28:55 OpenWrt user.notice root: (he-ipv4) [Warning] "/tmp/he-ipv4.url" does not exist, attempting to create file
Sep 22 19:28:55 OpenWrt user.notice root: (he-ipv4) [Info] "/tmp/he-ipv4.url" has successfully been created
Sep 22 19:29:05 OpenWrt user.notice root: (he-ipv4) [Info] The IPv4 endpoint address has been updated to x.x.x.x as well as saved to "/tmp/he-ipv4.ip"
Sep 22 19:29:05 OpenWrt user.notice root: (he-ipv4) [Warning] Killing interface for ten seconds
Sep 22 19:29:05 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:05 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:05 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:05 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:05 OpenWrt user.info firewall: removing henet (6in4-henet) from zone wan
Sep 22 19:29:15 OpenWrt user.info kernel: 6in4-henet: Disabled Privacy Extensions
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: attempting to reread config file
Sep 22 19:29:15 OpenWrt daemon.debug radvd[4555]: resuming normal operation
Sep 22 19:29:16 OpenWrt daemon.err radvd[4555]: poll error: Interrupted system call
Sep 22 19:29:16 OpenWrt daemon.warn radvd[4555]: Exiting, sigterm or sigint received.
Sep 22 19:29:16 OpenWrt user.notice ifup: Enabling Router Solicitations on henet (6in4-henet)
Sep 22 19:29:16 OpenWrt daemon.info radvd[4936]: version 1.8.3 started
Sep 22 19:29:16 OpenWrt user.notice root: (he-ipv4) [Info] henet and RAdvD have been restarted!
Sep 22 19:29:16 OpenWrt user.info firewall: adding henet (6in4-henet) to zone wanPozdrawiam