linux命令行(文本模式)下配置网络

番茄系统家园 · 2022-04-27 04:31:52

除了通用的ifconfig外,对于Redhat/Fedora发行版,有专用的配置工具-netconfig。比较而言,netconfig可以IP获取方式(静态或者DHCP获取)等。

netconfig --help
Usage: netconfig [OPTION...]
  --bootproto=(dhcp|bootp|none)     Boot protocol to use
  --gateway=STRING                  Network gateway
  --ip=STRING                       IP address
  --nameserver=STRING               Nameserver
  --netmask=STRING                  Netmask
  --hostname=STRING                 Hostname
  --domain=STRING                   Domain name
  -d, --device=STRING               Network device
  --nodns                           No DNS lookups
  --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://m.nndssk.com/wlaq/197292dRSw2C.html
猜你喜欢
最新应用
热门应用