kbr / fritzconnection

Python-Tool to communicate with the AVM Fritz!Box by the TR-064 protocol and the AHA-HTTP-Interface
MIT License
304 stars 59 forks source link

Connect to FB using IPV6 #41

Closed nlomb closed 3 years ago

nlomb commented 4 years ago

Hi Klaus,

is there a way to conntect to FB using IPV6 ? didn't find it in "https://fritzconnection.readthedocs.io/en/1.2.1/"

tnx

Norbert

lucasff commented 4 years ago

❯ host fritz.box fritz.box has address 192.168.178.1 fritz.box has IPv6 address fd00::2e3a:fdff:fe88:8422 fritz.box has IPv6 address 2003:ec:370b:2f00:2e3a:fdff:fe88:8422

did you try?

kbr commented 4 years ago

With ping6 it's possible to ping the box, but internally fritzconnection uses requests. I don't know whether requests provides ipv6 connections.

maribert commented 3 years ago

It actually does. I just tried it. If you put your literal IP address into square brackets, it should work, like so:

fh = FritzHosts(address='[fd00:0:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]', password='yyyyyyy')

or

fh = FritzHosts(address='[%s]' % fs.external_ipv6, password='yyyyyyyy') (if you have a valid FritzStatus object called "fs").

kbr commented 3 years ago

At first I thought you found a serious security bug because of using an external ipv6 address. This is not possible with ipv4 at all. Fortunately for ipv6 this does just work in the local network and not by an external access (I've checked it!).

kbr commented 3 years ago

Like to close this because it is kind of discussion. Btw. github now has discussions :)