Linux:CentOS7-Server的网络配置

CentOS7-Server的网络配置

CentOS7-x64-Server安装完成后,默认情况,dhcp是没有为其分配IP。需要使用指令dhclient为其分配一个IP地址。

# 查看IP
$ ip addr	# centos6中查看IP的指令是`ifconfig`

# 分配IP
$ dhclient

1568219142105

但这种动态分配的IP有租用时间限制,而且后面再启动系统,IP可能还会变化(如果在租用时限内使用完毕了,将其挂载起来,下次再开地址就不会变)。

建议通过修改网卡配置文件,将CentOS7配置成固定IP。

配置静态IP

实现步骤:

  • 修改网卡配置文件
  • 重启网卡

修改网卡配置文件

# 修改网卡配置文件
$ vim /etc/sysconfig/network-scripts/ifcfg-ens33	

# 如果打不开,说明vim工具未安装,可以换用`vi`来打开,也可以给CentOS系统安装vim工具
$ sudo yum install vim

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Deploy and manage today's essential services on an enterprise-class, open operating system About This Book * Configure and manage Linux servers in varying scenarios and for a range of business requirements * Explore the up-to-date features of CentOS using real-world scenarios * See practical and extensive recipes to deploy and manage CentOS Who This Book Is For This book is for Linux professionals with basic Unix/Linux functionality experience, perhaps even having set up a server before, who want to advance their knowledge in administering various services. What You Will Learn * See how to deploy CentOS easily and painlessly, even in multi-server environments * Configure various methods of remote access to the server so you don't always have to be in the data center * Make changes to the default configuration of many services to harden them and increase the security of the system * Learn to manage DNS, emails and web servers * Protect yourself from threats by monitoring and logging network intrusion and system intrusion attempts, rootkits, and viruses * Take advantage of today's powerful hardware by running multiple systems using virtualization In Detail CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You'll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS. Style and approach This easy-to-read cookbook is filled with practical recipes. Hands-on, task-based exercises will present you with real-world solutions to deploy and manage CentOS in varying business scenarios.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值