兄弟 亲测 不懂的加我
(1)Win系统 添加ip
FOR /L %i IN (2,1,254) DO netsh interface ip add address "Your_interface" 127.255.255.%i 255.0.0.0 注意的地方是需要改动网卡名字
(2)Centos
for I in $(seq 2 254);
do nmcli con mod Your_interface +ipv4.addresses 127.255.255.${I}; done; nmcli con up Your_interface
脚本命令