IPã¢ãã¬ã¹ãããããã¾ãããããIPã¢ãã¬ã¹ã®æ¯è¼ã»å¤å®ãCIDRä½æã»çµåãå解ã ã¬ã³ã¸ç¯å²æä½ã§ãªã©ãããã¯ã¼ã¯ã¨ã³ã¸ãã¢ã¯æ´»ç¨ããæ©ä¼ãå¤ãnetaddrã®èªåç¨ã«ä½¿ãæ¹ã¡ã¢ã¾ã¨ãã ã¡ã¢ãªãã§ä»å¾éæ追å ãã¦ããã¾ãã 1. netaddrã¤ã³ã¹ãã¼ã« pipã³ãã³ãã§ã¤ã³ã¹ãã¼ã« pip install netaddr 2.netaddrèªã¿è¾¼ã¿ from netaddr import * 3 netaddråºæ¬æä½ IPã¢ãã¬ã¹ã®ç¨®é¡åºå ip = IPAddress('192.0.2.1') print(ip.version) åºå 4 æåå(str)åã§åºå str(ip) intåã§ãã³ã°IPåºå ãã³ã°IPã¸å¤æ int(ip) æ¯è¼ int(ip) == 3221225985 True ãã®ä»åæä½ ããã¯ã¹ããã¤ããªãªã© hex(ip) '0xc0000201
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}