“Centos7.x配置网络”的版本间的差异
跳到导航
跳到搜索
(→参考) |
(→参考) |
||
第87行: | 第87行: | ||
[https://www.cnblogs.com/snake-hand/p/3143041.html linux route命令的使用详解 ] | [https://www.cnblogs.com/snake-hand/p/3143041.html linux route命令的使用详解 ] | ||
+ | |||
+ | |||
+ | [https://blog.csdn.net/God_luck/article/details/83548090 路由跟踪(tracert、traceroute)简析] | ||
[https://blog.csdn.net/MichealwlfBBLF/article/details/71330194 centos 7配置静态IP,并配置DNS] | [https://blog.csdn.net/MichealwlfBBLF/article/details/71330194 centos 7配置静态IP,并配置DNS] |
2020年4月14日 (二) 08:31的版本
解说
cat /etc/sysconfig/network-scripts/ifcfg-enp6s0 #添加如下内容 BOOTPROTO=static #启用静态IP地址 IPADDR0=192.168.88.10 #设置IP地址 NETMASK=255.255.255.0 #设置子网掩码 GATEWAY0=192.168.88.1 #设置网关 DNS1=8.8.8.8 #设置主DNS DNS2=114.114.114.114 #设置备DNS DEVICE=enp0s3 ONBOOT=yes cat /etc/resolv.conf # Generated by NetworkManager nameserver 192.168.88.1 nameserver 192.168.53.1 #重启网络 service network restart #othre TYPE="Ethernet" BOOTPROTO=static IPADDR0=192.168.0.9 NETMASK=255.255.255.0 GATEWAY0=192.168.0.1 DNS1=8.8.4.4 DNS2=114.114.114.114 DEVICE="eth0" ONBOOT="yes"
eg
cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE="Ethernet" BOOTPROTO="none" DEFROUTE="yes" IPV4_FAILURE_FATAL="no" IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6_DEFROUTE="yes" IPV6_FAILURE_FATAL="no" IPV6_ADDR_GEN_MODE="stable-privacy" NAME="eth0" UUID="ff71d3b7-aa7d-4ac5-a3ca-87e867fe2a64" DEVICE="eth0" ONBOOT="yes" DNS1="223.5.5.5" DOMAIN="223.5.5.5" IPADDR="192.168.88.50" PREFIX="24" GATEWAY="192.168.88.1" IPV6_PEERDNS="yes" IPV6_PEERROUTES="yes" IPV6_PRIVACY="no"
dns client
1. /etc/sysconfig/network-scripts/ifcfg-eth0 DNS1="223.6.6.6" #前面这个优先级比较高 其实上面不要写上dns更加清爽 2./etc/resolv.conf
troubleshooting
PREFIXO0=24 #设置子网掩码 会导致连上不外网