I'm trying to build a 'neighbour IP converter' for a point to point IP subnet in python
i.e.
ip_A = '192.168.70.70/31
ip_A_neigh = '192.168.70.71'
ip_B = '10.10.89.5/31
ip_B_neigh = '10.10.89.4'
I've been looking at ipaddress and iptools python modules but I'm still trying to find my way with python...
I suppose I can split and if the last octet is an even number, add by 1 If the last octet is an odd number, reduce it by 1.
Is there a better way?
Use ipaddress module. already build-in python3 https://docs.python.org/3/library/ipaddress.html