blueice 发表于 2018-5-19 08:59:55

《Linux菜鸟入门》Linux网络管理

  

  

  ●管理网络
  
  1.ip基础知识
      ipv4/ipv6

     32位
     172.25.0.10/255.255.255.0
     2.配置ip
      <<图形化>>
     1。图形界面
      nm-connection-editor
     2.文本化图形
      nmtui
  
      ifconfig                  查看或者临时设定主机ip的工具
      ifconfig 网络接口               查看这个接口上的 ip
      ifconfig 网络接口 ip netmask 子网掩码   临时设定ip
      ifconfig eth0 172.25.254.100 netmask 255.255.255.0
  
      systemctl restart network   重新启动网络基本服务
      systemctl restart NetworkManager网络智能管理服务
  

  <<命令>>
     ifconfig 网卡 ip netmask   临时设定
     nmcli :
      system ststus NetWork
   connection add type ethernetcon-name westos ifname eth0 autoconnect yes
   nmcli connection add type ethernet con-name westos ifname ip4 ip/24
   nmcli connection add delete westos
   nmcli connection show
   nmcli connection down westos
   nmcli connection up westos
   nmcli connection modify westos ipv4.addresses newip/24
   nmcli connection modify westos ipv4.method <auto|manual>
   nmcli device connect
   nmcli device disconnect
   nmcli device show
   nmcli device status
  
  <<文件>>
      dhcp   动态获取
      vim    /etc/sysconfig/network-scripts/ifcfg-eth0
      DEVICE=eth0
      BOOTPROTO=dhcp
      ONBOOT=yes
      NAME=eth0
      :wq
      systemctl restart network
  
      static|none   静态网络
        vim    /etc/sysconfig/network-scripts/ifcfg-eth0
     DEVICE=eth0
     BOOTPROTO=static|none
     ONBOOT=yes
     IPADDR(x)=172.25.0.100
     NETNASK=172.25.0.100 | PREFIS0=24   子网掩码
     NAME=eth0
      :wq
     systemctl restart network
      如果要设置多个ip 就在x位置
  
页: [1]
查看完整版本: 《Linux菜鸟入门》Linux网络管理