在Debian系統中,你可以使用ifconfig
命令來查看網絡接口的IP地址分配情況。以下是具體步驟:
ifconfig
打開終端。
輸入以下命令并按回車鍵:
ifconfig
你將看到類似以下的輸出,其中包含了各個網絡接口的詳細信息,包括IP地址、子網掩碼、廣播地址等。
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a00:27ff:fe4e:66a1 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:4e:66:a1 txqueuelen 1000 (Ethernet)
RX packets 1000000 bytes 100000000 (95.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1000000 bytes 100000000 (95.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1000 bytes 100000 (97.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1000 bytes 100000 (97.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ip addr
命令ip addr
命令提供了更現代和靈活的網絡接口信息查看方式。
ip addr show
ifconfig
,但格式更為簡潔和現代化。如果你只想查看某個特定網絡接口的信息,可以在命令中指定接口名稱。例如,查看eth0
接口的信息:
ifconfig eth0
或
ip addr show eth0
ifconfig
命令可能已被棄用,推薦使用ip
命令。通過以上方法,你可以輕松地在Debian系統中查看IP地址分配情況。