把ip地址用split分割开的正确的方法: public static void main(String[] args) { // TODO 自动生成方法存根 String goodspic ="127.0.0.1"; String[] tt=new String[200]; tt = goodspic.trim().split("\\."); int p=0; for( p=0;p"+tt[p]); } System.out.println("--->123123123"); } 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/75961/showart_1332279.html
把ip地址用split分割开的正确的方法: public static void main(String[] args) { // TODO 自动生成方法存根 String goodspic ="127.0.0.1"; String[] tt=new String[200]; tt = goodspic.trim().split("\\."); int p=0; for( p=0;p"+tt[p]); } System.out.println("--->123123123"); } 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/75961/showart_1332275.html
最近动不动就针对某个地区的ip做过滤限制, 往往给出的ip范围都只有起始地址和结束地址, 如202.96.52.0--202.96.138.0。 而Apache中做过滤设置时,是针对网段的, 为了将多个网段分割成最合适的网络大小, 特意写了一个简单的工具来处理这个问题。 希望能够帮助碰到同样问题的朋友。
问题:网段10.23.30.0/24;已使用ip:10.23.30.28/32 10.23.30.29/32 10.23.30.73/32 10.23.30.133/32 求该网段剩余ip最简表示法. [code] #!/bin/bash #net_split_2.sh #for subnet split #define global variable inthosts=(0 4 8 16 32 64 128 256) longnet=0 ip2long(){ local ip intip0 intip1 intip2 intip3 intip4 ip=($(echo "$1"|awk -F'.' '{print $1" "$2" "$3" "$4}')) let intip0="${ip[0]} << 24" let intip1="${...
ip:Internet Protocol ip is the workhorse protocol of the TCP/ip protocol suite. ip provides an unreliable, connectionless datagram delivery service. Unreliable:we mean there are no guarantees that an ip datagram successfully gets to its destination. Connectionless:we mean that ip does not maintain any state information about successive datagrams. ip Header: | 4bits | 4bits(*5=20B-60B) | ...
内网ip是以下面几个段开头的ip.用户可以自己设置.常用的内网ip地址: 10.x.x.x 172.16.x.x至172.31.x.x 192.168.x.x 内网的计算机以NAT(网络地址转换)协议,通过一个公共的网关访问Internet。内网的计算机可向Internet上的其他计算机发送连接请求,但Internet上其他的计算机无法向内网的计算机发送连接请求。 NAT(Network Address Translator)是网络地址转换,它实现内网的ip地址与公网的...
ip和子网掩码 我们都知道,IP是由四段数字组成,在此,我们先来了解一下3类常用的IP A类ip段 0.0.0.0 到127.255.255.255 B类ip段 128.0.0.0 到191.255.255.255 C类ip段 192.0.0.0 到223.255.255.255 XP默认分配的子网掩码每段只有255或0 A类的默认子网掩码 255.0.0.0 一个子网最多可以容纳1677万多台电脑 B类的默认子网掩码 255.255.0.0 一个子网最多可以容纳6万台电...
195.112.191.130 195.112.191.130 美国 CZ88.NET 195.128.33.0 195.128.33.255 美国 华盛顿 195.138.209.0 195.138.209.255 美国 CZ88.NET 195.141.86.80 195.141.86.111 美国 CZ88.NET 195.141.89.8 195.141.89.127 美国 CZ88.NET 195.141.102.48 195.141.102.79 美国 CZ88.NET 195.145.133.64 195.145.133.95 美国 CZ88.NET 195.145.152.128 195.145.152.143 美国 CZ88.NET 195.154.196.0 195.154.196.7 美国 CZ88.N...
209.0.0.0 209.9.255.255 美国/加拿大 CZ88.NET 209.10.0.0 209.10.255.255 美国 Globix 209.11.0.0 209.11.255.255 美国 CZ88.NET 209.12.0.0 209.12.255.255 美国/加拿大 CZ88.NET 209.14.0.0 209.18.255.255 美国/加拿大 CZ88.NET 209.19.0.0 209.19.255.255 美国 马里兰州 209.20.0.0 209.29.5.255 美国/加拿大 CZ88.NET 209.29.7.0 209.36.126.255 美国/加拿大 CZ88.NET 209.36.127.0 ...