IT/System & Network
phpIPAM IP 정보 추가
Hotman
2018. 4. 11. 11:36
- mysql에서 아래와 같이 실행하면 IP 주소별 노드 정보가 입력됨
mysql> insert into ipaddresses (subnetId, ip_addr, dns_name, mac, description, state) values ( <subnetId> , <ip_addr dec> , <hostname> , <Mac_Address> , <description>, 2 );
IP 정보는 dec 값으로 변환하여 사용한다.
- ex) 파이썬3을 이용한 간단한 ip to dec
MacBook:test X2$ python3
Python 3.6.3 (v3.6.3:2c5fed86e0, Oct 3 2017, 00:32:08)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ipaddress
>>> print (int(ipaddress.ip_address("192.168.100.100")))
3232261220
>>>