云计算基础 第十二章 网络管理
2020-03-05 11:43
706 查看
简介
网络接口名称规则
Network interface names Traditionally, network interfaces in Linux are enumerated as eth0, eth1, eth2, and so on. However, the mechanism which sets these names can cause changes to which interface gets which name as devices are added and removed. The default naming behavior in Red Hat Enterprise Linux 7 is to assign fixed names based on firmware, device topology, and device type. Interface names have the following characters: Ethernet interfaces begin with en, WLAN interfaces begin with wl, and WWAN interfaces begin with ww. The next character(s) represents the type of adapter with an o for on-board, s for hotplug slot, and p for PCI geographic location. Not used by default but also available to administrators, an x is used to incorporate a MAC address. Finally, a number N is used to represent an index, ID, or port. If the fixed name cannot be determined, the traditional names such as ethN will be used. For example, the first embedded network interface may be named eno1 and a PCI card network interface may be named enp2s0. The new names make it easier to distinguish the relationship between a port and its name if the user knows both, but the trade off is that users cannot assume a system with one interface calls that interface eth0. en:eethernet 以太网-双绞线 wl:wirelessLAN:无线网卡 ww:WAN广域网:串行线缆 o:on-board板载网卡 s:hotplug热插拔 p:PCI接口 N:序号或者ID 示例:enp2s0
NetworkManager服务
网络管理器(NetworkManager)是一个动态网络的控制器与配置系统,它用于当网络设备可用时保持设备和连接开启并激活 默认情况下,CentOS/RHEL 7 已安装网络管理器,并处于启用状态。 查看网络管理程序的状态 systemctl status NetworkManager 查看网络子管理程序的状态 systemctl status network
配置网络的工具
配置的方法,多种多样
图形 命令
命令行配置
配置文件:vim [root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32 今天就有老铁在这里栽跟头。自己本身是33,照着笔记打32 命令行: nmcli 如果没有这个命令,可以执行安装 yum -y install NetworkManager
图形配置
简易图形: nmtui 图形界面:nm-connection-editor
配置网络参数
配置IP
方法
1.配置网卡参数 先备份网卡配置文件,在修改 [root@qianfeng ~]# cp /etc/sysconfig/network-scripts/ifcfg-ens33 . 查看本机的自动获取的IP截图 命令行查看IP #ip a 命令行查网关 #ip r 命令行查dns #cat /etc/resolv.conf [root@qianfeng ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33 老铁,修改这个文件要慎重 ONBOOT=yes //是否启用该设备 BOOTPROTO=none //手动(none/static)还是自动(dhcp) IPADDR=192.168.142.131 老铁不能跟老师一样哈!!! //根据自动获取的地址进行配置 用来定位主机 NETMASK=255.255.255.0 //子网掩码 用来定义网络,这台主机是192.168.142的网络 GATEWAY=192.168.142.2 //网关,也叫默认路由 带你上网的路由器地址 DNS1=192.168.142.2 //DNS 域名解析。当你输入域名访问网站时,他告诉你IP地址。 根据截图配置 网卡信息 NAME=ens33 UUID=d1769473-dc3c-4cf3-9158-8798994d24bb UUID不是网卡配置文件中必须的信息 查看自身网卡UUID的命令 [root@localhost ~]# nmcli con DEVICE=ens33
2.重启网络服务
[root@qianfeng ~]#systemctl restart network
3.查看IP地址
#ip a
问题
windows虚拟网卡是否安装 VMware系统服务是否被优化掉 LINUX网络配置设置为开机启动
主机名
# hostnamectl set-hostname qianfeng.example.com # cat /etc/hostname # reboot
网络测试工具
测试工具
[root@qianfeng ~]# ip a //查看所有IP(ifconfig) [root@qianfeng ~]# ip route //查看路由,查看网关 [root@qianfeng ~]# ip neigh //另一台主机ping通,查看邻居 [root@qianfeng ~]# ping 127.0.0.1 PING (Packet Internet Groper),因特网包探索器 两台虚拟机需要通信,vmnet号一定要相同
ports and services
安装示例服务
[root@aliyun ~]# yum -y install httpd vsftpd [root@aliyun ~]# systemctl start httpd vsftpd
Show TCP sockets
[root@aliyun ~]# ss -tnl State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:80 *:* LISTEN 0 32 :::21 :::* [root@aliyun ~]# netstat -anpt
初始化服务器
最小化安装
兼容程序 开发包 1.为你的服务器配置root 密码。 2.配置IP地址(VMNAT8) 3.配置YUM 源 自动挂载光驱/阿里YUM 配置YUM仓库 4.关防火墙 systemctl stop firewalld systemctl disable firewalld systemctl status firewalld 5.selinux 临时关闭 setenfoce 0 永久关闭 [root@localhost ~]# vim /etc/sysconfig/selinux SELINUX=disabled 6.安装常用程序 yum install -y lrzsz sysstat elinks wget net-tools bash-completion 7.关机快照
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- 网络管理 SNMP基础知识
- 计算机网络基础(三)子网划分及子网掩码计算方法
- 网络管理基础
- 神经网络和深度学习-第二周神经网络基础-第七节:计算图
- 网络基础 ip地址的概念和掩码计算(全面讲解)
- 网络基础知识、linux路由管理命令(route) 、ip命令、ifconfig命令的使用、linux网卡配置
- Nmcli 网络管理命令行工具基础
- Zigbee网络管理基础实验失败后的收获
- Linux基础--网络管理
- 第十二章 网络管理-centos7.5知识
- 基础编程题目集 6-10 阶乘计算升级版 -- 来自网络
- linux基础知识3-网络管理
- Mocha BSM基础架构管理――灵活的网络拓扑展现
- 华为FusionSphere概述——计算资源、存储资源、网络资源的虚拟化,同时对这些虚拟资源进行集中调度和管理
- 马哥2016全新Linux+Python高端运维班-Linux 网络基础管理,包管理,bash脚本练习
- 五大流程成就网络运维管理的基础
- Linux基础(网络管理、配置虚拟机和配置yum源)
- Linux用户管理(九)Linux网络基础
- Nmcli 网络管理命令行工具基础
- Nmcli 网络管理命令行工具基础