Vor ein paar Wochen veröffentlichte ich erst den letzten Eintrag zu diesem Thema. Damals aber noch zu unserem ZyXel Router, der mittlerweile den Geist aufgegeben hat.
Also musste schleunigst ein neuer Router her. Wir entschieden uns für die neue FRITZ!Box Fon WLAN 7270. Dieser Router übernahm auch gleich die Funktion unserer alten DECT Telefonanlage.
Aber nun zu dem Skript. Die Fritz Box lässt sich leichter zu einer neuen IP Adresse bewegen. Hier genügt eine einfache UPNP Anfrage:
#!/bin/bash
curl 'http://fritz.box:49000/upnp/control/WANIPConn1' \
-H 'Content-Type: text/xml; charset="utf-8"' \
-H 'SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination' \
-d '<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <u:ForceTermination xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1" /> </s:Body> </s:Envelope>'
Dieses Script funktioniert mit der Fritz Box 7270 und wahrscheinlich auch anderen Fritz Boxen.
Mit der FB 7141 funktionierts nicht:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Dokumente und Einstellungen\xxxx>c:\Ablage\curl\curl.exe „http://fritz
.box:49000/upnp/control/WANIPConn1“ -H ‚Content-Type: text/xml; charset=“utf-8″‚
-H ‚SoapAction: urn:schemas-upnp-org:service:WANIPConnection:1#ForceTermination
‚ -d ‚
500 Internal Server Error (ERR_INVALID_REQ)500 Internal Server ErrorERR_INVALID_REQWebserver Sun
, 29 Aug 2010 03:02:12 GMT
curl: (6) Could
not resolve host: text; Host not found
curl: (6) Could not resolve host: charset=utf-8′; Host not found
curl: (6) Could not resolve host: urn:schemas-upnp-org:service:WANIPConnection:1
#ForceTermination‘; No data record of requested type