惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
The Last Watchdog
The Last Watchdog
Cyberwarzone
Cyberwarzone
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The Cloudflare Blog
V
V2EX
博客园_首页
博客园 - 聂微东
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
T
Tenable Blog
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News | PayPal Newsroom
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
博客园 - 【当耐特】
Forbes - Security
Forbes - Security
H
Hacker News: Front Page
A
About on SuperTechFans
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
罗磊的独立博客
D
DataBreaches.Net
P
Privacy & Cybersecurity Law Blog
Schneier on Security
Schneier on Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
D
Docker
P
Proofpoint News Feed

噜啦 - Linux笔记本

du和ls查看文件大小不同的原因 - 噜啦 服务管理工具 systemctl - 噜啦 进程的控制与进程之间的关系 - 噜啦 ps 和 top 命令查看进程 - 噜啦 Grub 配置文件介绍以及忘记root密码的解决方法 - 噜啦 CentOS 手动升级/安装内核 - 噜啦 网络故障排除命令 - 噜啦 route 查看路由 - 噜啦 ifconfig 网络管理 - 噜啦
网络管理和配置文件 - 噜啦
博主: 噜啦 · 2020-05-17 · via 噜啦 - Linux笔记本

网络管理和配置文件

  • 发布时间:
  • 1459 次浏览
  • 1951字数
  • 分类: Linux笔记本
  1. 首页
  2. 正文  

禁用network

chkconfig --list network

network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

chkconfig --level 2345 network off

network         0:off   1:off   2:off   3:off   4:off   5:off   6:off

chkconfig --level 2345 network on

network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

CentOS7 禁用 NetworkManager,向下兼容CentOS6

systemctl disable NetworkManager

查看网络的配置文件

cd /etc/sysconfig/network-scripts/
ls ifcfg-*
cat ifcfg-eth0

可以看到

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=51.161.63.226
GATEWAY=158.69.116.254
NETMASK=255.255.255.255
DNS1=8.8.8.8

修改配置后重启服务

service network restart
或者
systemctl restart NetworkManager.service

查看网络配置
ifconfig eth0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 51.161.63.226  netmask 255.255.255.255  broadcast 51.161.63.226
        inet6 fe80::250:56ff:fe0c:16e2  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:0c:16:e2  txqueuelen 1000  (Ethernet)
        RX packets 58292  bytes 3653738 (3.4 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1950  bytes 281005 (274.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

查看路由信息
route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         158.69.116.254  0.0.0.0         UG    100    0        0 eth0
51.161.63.226   0.0.0.0         255.255.255.255 UH    100    0        0 eth0
158.69.116.254  0.0.0.0         255.255.255.255 UH    100    0        0 eth0

查看DNS服务器

nslookup
> server
Default server: 8.8.8.8
Address: 8.8.8.8#53
Default server: 8.8.4.4
Address: 8.8.4.4#53

修改hostname

hostnamectl set-hostname c7.lula
修改后,需要修改hosts,否则会出现服务器重启速度慢的问题(超时等待)
vi /etc/hosts
添加一行
127.0.0.1 c7.lula

赞赏作者

如果觉得我的文章对你有用,请随意赞赏

网络管理和配置文件

 •