小工具--IPgen--根據(jù)掩碼生成有效IP地址

如果你不是很熟悉網(wǎng)絡(luò)掩碼計(jì)算,每次要從一個(gè)IP和掩碼中得到有效的IP地址總是很煩人,要推算好幾次。

一個(gè)小工具IPgen,可以根據(jù)掩碼生成有效IP地址。

項(xiàng)目地址:

https://github.com/royhills/ipgen

來自:

http://www.nta-monitor.com/

Man手冊

The IP networks can be specified in the following ways:

a) CIDR notation IPnetwork/bits (e.g. 192.168.1.0/24)
b) Network and mask notation IPnetwork:NetMask (e.g. 192.168.1.0:255.255.255.0)
c) Range notation IPstart-IPend (e.g. 192.168.1.3-192.168.1.27)
d) Single IP Host Address (e.g. 192.168.1.1)

The CIDR and Network:mask notations generate IP host addresses excluding the
network and broadcast addresses. So 10.0.0.0/29 would generate six IP addresses
from 10.0.0.1 to 10.0.0.6 inclusive. But see the description of the --network
(-n) and --broadcast (-b) options below.

The generated IP host addresses are written to standard output, with one IP
address per line.

The IP networks may be specified either on the command line, or read from the
file specified with the --file (-f) option.

Options:


--help or -h            Display this usage message and exit.

--file=<f> or -f <f>    Read IP networks from the specified file instead of
                        from the command line. One IP network specification per
                        line. Use "-" for standard input.

--version or -V         Display program version and exit.

--network or -n         Include the IP network address.

--broadcast or -b       Include the IP broadcast address.

常用命令

我已經(jīng)有一個(gè)地址192.168.10.139,需要新的地址段,擴(kuò)大到8個(gè)地址,要在29位掩碼范圍內(nèi)。

ftpuser@hwcgback:~/ipgen$ ipgen 192.168.10.139/29 -b -n 
WARNING: host part of 192.168.10.139/29 is non-zero
192.168.10.136
192.168.10.137
192.168.10.138
192.168.10.139
192.168.10.140
192.168.10.141
192.168.10.142
192.168.10.143

還可以用掩碼方式

ftpuser@hwcgback:~/ipgen$ ipgen 192.168.10.139:255.255.255.248 -b -n    
WARNING: host part of 192.168.10.139:255.255.255.248 is non-zero
192.168.10.136
192.168.10.137
192.168.10.138
192.168.10.139
192.168.10.140
192.168.10.141
192.168.10.142
192.168.10.143
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 名詞延伸 通俗的說,域名就相當(dāng)于一個(gè)家庭的門牌號碼,別人通過這個(gè)號碼可以很容易的找到你。如果把IP地址比作一間房子...
    楊大蝦閱讀 20,787評論 2 56
  • 國際規(guī)定:把所有的IP地址劃分為A,B,C,D,E。 A類地址:范圍從0~127,0是保留的并且表示所有IP地址,...
    日風(fēng)和閱讀 21,565評論 1 8
  • 1、概念簡介 子網(wǎng)掩碼子網(wǎng)掩碼又叫網(wǎng)絡(luò)掩碼、地址掩碼,是一個(gè)32位地址,用于屏蔽IP地址的一部分以區(qū)別網(wǎng)絡(luò)號和主機(jī)...
    黒貓閱讀 8,025評論 0 23
  • IP地址的分類(記住) IP地址分為A類、B類、C類、D類、E類,規(guī)定如下: A類:網(wǎng)絡(luò)位8位,主機(jī)位24位,網(wǎng)絡(luò)...
    Arya鑫閱讀 13,186評論 1 18
  • 高迪出生在巴塞羅那的塔拉戈納這一美麗的鄉(xiāng)村,這里是藝術(shù)大師的搖籃,畢加索、達(dá)利、以及三大男高音之一卡雷拉斯都誕生于...
    七年三日閱讀 683評論 0 3

友情鏈接更多精彩內(nèi)容