在
Redhat
早期的版本中,
有
linuxconf
、
redhat-config-network
、
netconfig
等工具;
在
Redhat/Fedora
最新的版本有
system-config-network-tui
(文本模式的
)
、
system-config-network
(图形模式的),
netconfig
(文本模式的)。
这些工具都会直接修改
Linux
系统中关于网络接口的配置文件;这是
ifconfig
所不能比的;
其中
redhat-config-network
和
system-config-network
工具不仅仅是配置网卡的工具,还有配置
ISDN
和普通猫、
ADSL
的工具、网络硬件的添加、主机名字的配置、
DNS
各客户端的配置等。其实是一个工具组的集成;
这些工具比较简单,以
root
权限运行命令就能调用,比如:
[root@localhost]# /usr/sbin/system-config-network
[root@localhost]# system-config-network
[root@localhost]# system-config-network
netconfig
工具是一个在文本模式比较好的工具,推荐大家使用;理由是这个工具在文本模式下,也有一个简单的图形界面;还有命令模式;
[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 messag e
--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 messag e
设置网卡的
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/xfoxgy/89142