查本机网络信息

ifconfig

查询本机dns

cat /etc/resolv.conf

启动/关闭  网卡

ifup eth0

ifdown eth0

网卡静态ip动态ip配置

vim /etc/network/interface

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
#iface eth0 inet static
#address 192.168.1.7
#netmask 255.255.255.0
#gateway 192.168.1.1
#dns-nameservers 192.168.1.6
#iface eth0 inet6 static
#pre-up modprobe ipv6
#address 2001:620:40b:555::7
#netmask 64
#gateway 2001:620:40b:555::1
#dns-nameservers fe80::1e1b:dff:fecc:cff6

改完后记得

/etc/init.d/networking restart

 

相关文章:

  • 2022-12-23
  • 2022-01-28
  • 2022-01-10
  • 2022-12-23
  • 2021-11-22
  • 2021-09-22
  • 2021-09-22
  • 2022-01-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-12-30
  • 2022-12-23
  • 2021-11-20
  • 2021-12-07
相关资源
相似解决方案