1 (edytowany przez Nimloth 2012-09-22 19:39:27)

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 curl

2) Sciagamy skrypt zmodyfikowany na potrzemy OpenWRT (wybierz jedno zrodlo):
a) IPv4:

wget -q -P /usr/sbin http://nimloth.pl/he-ipv4

b) IPv6:

wget -q -P /usr/sbin http://ipv6.nimloth.pl/he-ipv4

oraz nadajemy mu odpowiednie atrybuty

chmod 755 /usr/sbin/he-ipv4

3) 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 | md5sum

gdzie 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/root

badz/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 0

Informacje 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. Exiting

b) 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 wan

Pozdrawiam

2

Odp: HEnet IPv6 a dynamiczne IPv4

Nie wiem czy wiesz, ale pakiet 6in4 zawiera skrypt na hotplugu, który wykonuje dokładnie to co napisałeś przy podniesieniu interfejsu... Właśnie po to jak masz dynamiczne ip które się zmienia.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez Nimloth 2012-09-22 19:47:27)

Odp: HEnet IPv6 a dynamiczne IPv4

Hmm nie wiedzialem ... ale juz kilka razy zmienilo mi sie IP i niestety zmiany musialem dokonac recznie ... tak wiec moze nie do konca dziala ?

OK jezeli jest tak to pusc temat w kosmos smile

4

Odp: HEnet IPv6 a dynamiczne IPv4

Sprawdź sobie go po prostu. Odpala się na ifup, wymaga w konfigu user, pass i tunel id. Robi wgeta do tunelbrokera, który za zadanie zaktualizować adres.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5 (edytowany przez Nimloth 2012-09-22 19:57:54)

Odp: HEnet IPv6 a dynamiczne IPv4

OK chyba widze czemu nie dziala defaultowo
/etc/hotplug.d/iface/90-6in4

local url="http://ipv4.tunnelbroker.net/ipv4_end.php?ipv4b=AUTO&user_id=$username&pass=$password&tunnel_id=$tunnelid"

Prawidlowy wpis

https://ipv4.tunnelbroker.net/ipv4_end.php?ip=IPV4ADDR&pass=MD5PASS&apikey=USERID&tid=TUNNELID

i najwazniejsze

IPV4ADDR: Your IPv4 endpoint.  Set to AUTO to determine your IP based on the IP you requested this page from.  Previously passed as ipv4b.

Innymi slowy HEnet przerobil troche parametry ktory przyjmuje ... a defaultowy skrypt uzywa starych.

Zgadzasz sie z tym ?

EDIT: Chociaz jest tez info

The legacy parameter names will continue to work for the forseable future.  Naming of them changed to be more in line with industry convention and their roles.

No coz moze tylko mi nie dziala smile

6

Odp: HEnet IPv6 a dynamiczne IPv4

W Backfire jest po staremu. W trunku już wg nowej składni. Wywołaj z palca ten wget i zobacz czy jeszcze działa. Działało jeszcze jak ja to pisałem.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.