iv-org / smart-ipv6-rotator

IPv6 rotator for specific subnets - unblock restrictions on IPv6 enabled websites (Google by default but customizable for others)
GNU Affero General Public License v3.0
81 stars 11 forks source link

BUG: host bits set #12

Closed bitnol closed 10 months ago

bitnol commented 10 months ago

OS: Debian 12 Executed as root.

Debug info:

[INFO] You have IPv6 connectivity. Continuing. [INFO] No cleanup of previous setup needed. Traceback (most recent call last): File "/home/smart-ipv6-rotator/smart-ipv6-rotator.py", line 310, in SmartIPv6Rotator() File "/home/smart-ipv6-rotator/smart-ipv6-rotator.py", line 53, in init getattr(self, args.command)() File "/home/smart-ipv6-rotator/smart-ipv6-rotator.py", line 183, in run ipv6_network = IPv6Network(args.ipv6range) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/ipaddress.py", line 2227, in init raise ValueError('%s has host bits set' % self) ValueError: xxxx:xxxx:xxx:xx:xxxx:xxxx:xxxx:1/112 has host bits set

bitnol commented 10 months ago

I was able to fix it by changing the code in smart-ipv6-rotator.py line no 183

ipv6_network = IPv6Network(args.ipv6range) to ipv6_network = IPv6Network(args.ipv6range, False)

Hope this helps.

unixfox commented 10 months ago

Can you paste the args that you passed to the script?

You are not supposed to pass the "host" bit of the ipv6 address. But only the ipv6 range like specified in the example.

bitnol commented 10 months ago

Below was the command: python3 /home/smart-ipv6-rotator/smart-ipv6-rotator.py run --ipv6range=xxxx:xxx:xxx:xx:xxxx:xxxx:xxxx:0001/112

unixfox commented 10 months ago

That's what I thought. Don't include the host bits.

Make sure to calculate the ipv6 range using this tool: http://www.gestioip.net/cgi-bin/subnet_calculator.cgi