由 lhc9732 在 12-30-2003 16:01 发表:
关于IP地址网段的问题
看了一片用TC限制带宽的文章,但里面的172.17.0.0/16
这个不知道是什么意思,哪位能否帮忙解释一下,这个东西是怎么换算的
如果我的内网是10.2.1.*
子网掩码是:255.255.0.0
如果我要按照上面写的,
10.2.1.0/*
这个星应该是多少?怎么办的?
谢谢。急。在线等
由 Snoopy 在 12-30-2003 16:06 发表:
拿来的
#!/bin/bash
all=(${@//[!0-9]/ })
[ "${#all[@]}" != "8" ] && {
echo "Usage: "
echo "${0##*/} ip.ip.ip.ip/mask.mask.mask.mask"
exit 1
}
get_mask () {
unset mask
while [ "$1" ]; do
bit=$(echo "obase=2;ibase=10;$1" |bc)
shift
mask="$mask$bit"
done
mask=${mask%%0*}
echo ${#mask}
}
maskpart=${@##*/}
echo "${@%%/*}/$(get_mask ${maskpart//./ })"
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then will I begin to under
由 lhc9732 在 12-30-2003 16:12 发表:
你可能没明白我的意思。我是想知道那是怎么算出来的
我现在照着网上的文章作,只有这个172.17.0.0/16
我如果换成我现在的内网IP地址该填什么呢?
我的内网IP段是10.2.1.*
掩网是:255.255.0.0
我如果按我的现在的IP段,
我该怎么写?
10.2.1.0/*
就最后面这个*该填什么啊!
由 Snoopy 在 12-30-2003 16:24 发表:
http://211.93.98.22/bbs/showthread....;threadid=56330
And then in the evening light, when the bars of freedom fall
I watch the two of you in the shadows on the wall
How in the darkness steals some of the choices from my hand
Then