Linux之临时配置网络(ip,网关,dns)+永久配置
作业一:临时配置网络(ip,网关,dns)+永久配置
- 配置网络信息
[root@localhost ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.202.131 netmask 255.255.255.0 broadcast 192.168.202.255
inet6 fe80::20c:29ff:fe9d:a0df prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9d:a0:df txqueuelen 1000 (Ethernet)
RX packets 23620 bytes 2085149 (1.9 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12933 bytes 1815875 (1.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 2767 bytes 389871 (380.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2767 bytes 389871 (380.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ifconfig eno16777736 192.168.202.132/24
Connection closed by foreign host.

[root@localhost network-scripts]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.202.132 netmask 255.255.255.0 broadcast 192.168.202.255
inet6 fe80::20c:29ff:fe9d:a0df prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:9d:a0:df txqueuelen 1000 (Ethernet)
RX packets 23954 bytes 2108353 (2.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 13040 bytes 1827860 (1.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 2767 bytes 389871 (380.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2767 bytes 389871 (380.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

- 配置网关
[root@localhost network-scripts]# vim /etc/resolv.conf
[root@localhost network-scripts]# route add default gw 192.168.202.2 netmask 255.255.255.0
[root@localhost /]# route -n
[root@localhost /]# route del default gw 192.168.202.2 netmask 255.255.255.0
[root@localhost /]# route -n
3.永久配置
[root@localhost /]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls
[root@localhost network-scripts]# vim ifcfg-eno16777736


Linux之临时配置网络(ip,网关,dns)+永久配置的更多相关文章
- CentOS 6.9配置网卡IP/网关/DNS命令详细介绍及一些常用网络配置命令(转)
一.IP 即时生效(重启后失效): ifconfig eth0 192.168.1.102 netmask 255.255.255.0 //添加IP地址 route add default gw 19 ...
- Linux如何配置网络ip?
Linux如何配置网络ip? 1.首先切换至root用户 su root 输入root用户密码 2.借助dhclient工具自动生成一个网络内可用的ip地址 我们可以手动配置对应的网段的ip地址,但是 ...
- CentOS7配置网络ip地址
CentOS7配置网络ip地址 CentOS 7.x版本中没有ifcfg-eth0文件 只有ifcfg-ens33文件(为了符合日常习惯) (1)将文件ifcfg-ens33重命名为ifcfg-eth ...
- CentOS工作内容(三)配置网络IP地址
CentOS工作内容(三)配置网络IP地址 用到的快捷键 tab 自动补齐(有不知道的吗) ctrl+a 移动到当前行的开头(a ahead) ctrl+u 删除(剪切)此处至开始所有内容 vim 末 ...
- CMD 配置静态IP与DNS
配置静态IP与DNS # 修改IP netsh interface ip set address "网络连接" static IP地址 子网掩码 默认网关 # 修改DNS nets ...
- VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装
VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装在阿里云开源镜像地址下载镜像Index of /centos/7.2.1511/isos/x86_64/http://mirro ...
- Ubuntu 16.04修改配置静态IP和DNS
Ubuntu 16.04修改配置静态IP和DNS 1.修改interfaces 文件 sudo gedit /etc/network/interfaces 2.添加 例如: auto enp0s25 ...
- ubuntu 命令配置ip 网关 dns
如果是在虚拟机中使用Ubuntu,先设置好主机的网络,然后配置虚拟机Ubuntu的IP和网关 如果主机操作系统就是Ubuntu,请直接参照下文进行设置 内容如下: 1. 检验是否可以连通,就使用pin ...
- Ubuntu命令设置ip网关dns
本文系转载,介绍Ubuntu如何设置IP和网络来连接网络 如果是在虚拟机中使用Ubuntu,那么设置之前请先参照我的上一遍文章虚拟机Net方式设置连接外网中的网络设置部分,先设置好主机的网络,然后配置 ...
- Linux系统下配置网络、JAVA环境,配置tomcat,mysql
一.配置网络 1.进入自己的系统,并跳转到network-scripts 2.编辑 3.查看系统的信息 4.将其添加到刚刚的if-cfg-eth0中 5.重启网络 6.这个时候ping百度还是ping ...
随机推荐
- Spring data JPA中使用Specifications动态构建查询
有时我们在查询某个实体的时候,给定的条件是不固定的,这是我们就需要动态 构建相应的查询语句,在JPA2.0中我们可以通过Criteria接口查询,JPA criteria查询.相比JPQL,其优势是类 ...
- pp 总结一
1.JQ $.get() <!DOCTYPE html> <html lang="en"> <head> <meta charset=&q ...
- Faster-RCNN tensorflow 程序细节
tf-faster-rcnn github:https://github.com/endernewton/tf-faster-rcnn backbone,例如vgg,conv层不改变feature大小 ...
- Tensorflow name_scope
在 Tensorflow 当中有两种途径生成变量 variable, 一种是 tf.get_variable(), 另一种是 tf.Variable(). 使用tf.get_variable()定义的 ...
- 【Android】android文件的写入与读取---简单的文本读写context.openFileInput() context.openFileOutput()
最终效果图,点击save会保存到文件中,点击show会从文件中读取出内容并显示. main.xml <?xml version="1.0" encoding="ut ...
- aws上ecs上tomcat8080端口打开但是无法访问
参考: https://yq.aliyun.com/articles/92050?t=t1 1. 安全组设置 2. 防火墙规则 3. 查看 8080 端口是否绑定到 127.0.0.1上的.如果是 ...
- Flask--第三个例子,写一个接口,该接口返回html前端页面,模板的使用
将接口数据返回至html前端页面有两种方法 方法一: 1 @app.route('/index',methods=['get']) 2 def open_index(): 3 page=open(' ...
- Scrapy-redis 安装配置使用
# 安装redis服务器端 sudo apt-get install redis-server # 安装scrapy和scrapy-redis库 pip install scrapy pip inst ...
- scrapy选择器归纳
python 爬虫: srcrapy框架xpath和css选择器语法 Xpath基本语法 一.常用的路径表达式: 表达式 描述 实例 nodename 选取nodename节点的所有子节点 //div ...
- Philosopher’s Walk(递归)
In Programming Land, there are several pathways called Philosopher’s Walks for philosophers to have ...