We've been doing IPv4 and IPv6 dual-stack recently.
That is, add an IPv6 address to the original IPv4 address.
Looking at Figure 1, the last bit (network bit) of the IPv4 address and the IPv6 address are the same. Since there are many hosts, we plan to write a batch to achieve this.
What is the way to get the last bit of the IPv4 address?
For example, as shown in Figure 2, this is my network card. How do you take this 130 out?
Our approach is this:
The first three digits of an IPv4 address are fixed, only the last bit is uncertain.
192.168.1.%% Make a loop, start with 129, add 1 each time, all the way to 254, see if that can all match my address.
Is there any better way? Please help me, thank you very much.
——————————————————————————
我们最近在做IPv4、v6双栈。
即在原有的IPv4地址上再添加一个IPv6地址。
看看图1,IPv4和IPv6地址的最后一位(网络位)都是一样的.由于主机较多,我们打算写个批处理来实现这个事情。
请问有什么方法可以取出IPv4地址的最后一位?
举个例子,如图2,这是我的网卡。怎么把这个130取出来呢?
我们的方法是这样:
IPv4地址的前三位是固定的,只有最后一位不确定。
192.168.1.%%做个循环,129开始,每次加1,一直到254,看看那个可以全部匹配到我的地址。
请问还有什么更好的方法吗?