Project

General

Profile

Tâche #20296

Scénario #20202: ajouter une importation/exportation pour eole-dhcp

Carottage et prise en main de librairies de manipulation d'adresses ip en python

Added by Gwenael Remond over 4 years ago. Updated over 4 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
Gwenael Remond
Start date:
11/13/2015
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Remaining (hours):
0.0

Description

- IPy est vieux et n'est plus maintenu
- python-iptools n'est pas standard
- ipaddress est la solution standar en python 3, un backport existe en python 2

History

#1 Updated by Gwenael Remond over 4 years ago

  • Status changed from Nouveau to En cours

#2 Updated by Gwenael Remond over 4 years ago

  • % Done changed from 0 to 100

#3 Updated by Gwenael Remond over 4 years ago

utiliser ipaddress, ça marche très bien en python 2

>>> ip1 = ipaddress.ip_address('192.0.2.1')
>>> ipaddress.ip_network('192.0.2.0/24')
IPv4Network('192.0.2.0/24')
>>> ipaddress.ip_network('192.0.2.0')
IPv4Network('192.0.2.0/32')
>>> ipaddress.ip_network('192.0.2.0')
IPv4Network('192.0.2.0/32')
>>> ipaddress.ip_interface("192.0.2.0")
IPv4Interface('192.0.2.0/32')
>>> ipaddress.ip_interface("192.0.2.0")
IPv4Interface('192.0.2.0/32')
>>> 

utiliser le calcul d'adresses pour la réservation dhcp

address_exclude
for addr in IPv4Network('192.0.2.0/28'):
...     addr
...

#4 Updated by Gwenael Remond over 4 years ago

  • Estimated time set to 2.00 h
  • Remaining (hours) set to 2.0

#5 Updated by Gwenael Remond over 4 years ago

  • Remaining (hours) changed from 2.0 to 0.0

IPy permet de faire le calcul d'ensemble d'IP correctement

#6 Updated by Gwenael Remond over 4 years ago

  • Status changed from En cours to Fermé

Also available in: Atom PDF