然后到网上看了些人家用netconfig的方法,这工具在现在 的新版系统中已经没有了,如果需要得自己下载rpm软件包。
[root@localhost]# netconfig -d eth0 注:配置eth0
[root@localhost]# netconfig -d eth1 注:配置eth1
[root@localhost]# netconfig -d eth1 注:配置eth1
netconfig 的用法如下:
[root@localhost]# netconfig --help 注:帮助;
--bootproto=(dhcp|bootp|none) Boot protocol to use(
--gateway=STRING Network gateway(指定网关)
--ip=STRING IP address(指定IP地址)
--nameserver=STRING Nameserver(指定DNS客户端)
--netmask=STRING Netmask(指定网络掩码)
--hostname=STRING Hostname( 指定主机名)
--domain=STRING Domain name(指定域名)
-d, --device=STRING Network device (指定网络设备)
--nodns No DNS lookups (没有DNS查询)
--hwaddr=STRING Ethernet hardware address (指定网卡的物理地址)
--description=STRING Description of the device (描述性文字)
Help options: (帮助选项)
-?, --help Show this help message
--usage Display brief usage message
--bootproto=(dhcp|bootp|none) Boot protocol to use(
--gateway=STRING Network gateway(指定网关)
--ip=STRING IP address(指定IP地址)
--nameserver=STRING Nameserver(指定DNS客户端)
--netmask=STRING Netmask(指定网络掩码)
--hostname=STRING Hostname( 指定主机名)
--domain=STRING Domain name(指定域名)
-d, --device=STRING Network device (指定网络设备)
--nodns No DNS lookups (没有DNS查询)
--hwaddr=STRING Ethernet hardware address (指定网卡的物理地址)
--description=STRING Description of the device (描述性文字)
Help options: (帮助选项)
-?, --help Show this help message
--usage Display brief usage message
设置网卡的DHCP模式自动获得IP
[root@localhost]# netconfig -d eth0 --bootproto=dhcp
手动设置网卡的IP等
[root@localhost]# netconfig -d eth0 --ip=192.168.1.33 --netmask=255.255.255.0 --gateway=192.168.1.1转载于:https://blog.51cto.com/thgenius/729091