在 CentOS 虚拟机中,可以使用命令行工具 ifconfig
来配置网卡。
例如,要为网卡 eth0
配置 IP 地址 192.168.1.100
,子网掩码 255.255.255.0
,网关 192.168.1.1
,可以使用如下命令:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 eth0
在 CentOS 虚拟机中,可以使用命令行工具 ifconfig
来配置网卡。
例如,要为网卡 eth0
配置 IP 地址 192.168.1.100
,子网掩码 255.255.255.0
,网关 192.168.1.1
,可以使用如下命令:
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 eth0