作业一:临时配置网络(ip,网关,dns)+永久配置

  1. 配置网络信息

[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

  1. 配置网关

[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)+永久配置的更多相关文章

  1. CentOS 6.9配置网卡IP/网关/DNS命令详细介绍及一些常用网络配置命令(转)

    一.IP 即时生效(重启后失效): ifconfig eth0 192.168.1.102 netmask 255.255.255.0 //添加IP地址 route add default gw 19 ...

  2. Linux如何配置网络ip?

    Linux如何配置网络ip? 1.首先切换至root用户 su root 输入root用户密码 2.借助dhclient工具自动生成一个网络内可用的ip地址 我们可以手动配置对应的网段的ip地址,但是 ...

  3. CentOS7配置网络ip地址

    CentOS7配置网络ip地址 CentOS 7.x版本中没有ifcfg-eth0文件 只有ifcfg-ens33文件(为了符合日常习惯) (1)将文件ifcfg-ens33重命名为ifcfg-eth ...

  4. CentOS工作内容(三)配置网络IP地址

    CentOS工作内容(三)配置网络IP地址 用到的快捷键 tab 自动补齐(有不知道的吗) ctrl+a 移动到当前行的开头(a ahead) ctrl+u 删除(剪切)此处至开始所有内容 vim 末 ...

  5. CMD 配置静态IP与DNS

    配置静态IP与DNS # 修改IP netsh interface ip set address "网络连接" static IP地址 子网掩码 默认网关 # 修改DNS nets ...

  6. VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装

    VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装在阿里云开源镜像地址下载镜像Index of /centos/7.2.1511/isos/x86_64/http://mirro ...

  7. Ubuntu 16.04修改配置静态IP和DNS

    Ubuntu 16.04修改配置静态IP和DNS 1.修改interfaces 文件 sudo gedit /etc/network/interfaces 2.添加 例如: auto enp0s25 ...

  8. ubuntu 命令配置ip 网关 dns

    如果是在虚拟机中使用Ubuntu,先设置好主机的网络,然后配置虚拟机Ubuntu的IP和网关 如果主机操作系统就是Ubuntu,请直接参照下文进行设置 内容如下: 1. 检验是否可以连通,就使用pin ...

  9. Ubuntu命令设置ip网关dns

    本文系转载,介绍Ubuntu如何设置IP和网络来连接网络 如果是在虚拟机中使用Ubuntu,那么设置之前请先参照我的上一遍文章虚拟机Net方式设置连接外网中的网络设置部分,先设置好主机的网络,然后配置 ...

  10. Linux系统下配置网络、JAVA环境,配置tomcat,mysql

    一.配置网络 1.进入自己的系统,并跳转到network-scripts 2.编辑 3.查看系统的信息 4.将其添加到刚刚的if-cfg-eth0中 5.重启网络 6.这个时候ping百度还是ping ...

随机推荐

  1. [转] history.back()和history.go()的区别

    Javascript:history.go()和history.back()的用法和区别 go(-1): 返回上一页,原页面表单中的内容会丢失:history.go(-1):后退+刷新:history ...

  2. Vs2015 本地git获取的代码目录文件修改后,启动提示error:Unable to start program “C:\Program Files\dotnet\dotnet.exe” 已解决.

    http://stackoverflow.com/questions/39938453/unable-to-start-program-c-program-files-dotnet-dotnet-ex ...

  3. 【bzoj5072】[Lydsy十月月赛]小A的树 树形背包dp

    题解: 比较好想 首先注意到如果最暴力的做法复杂度无法接受 而5000的范围基本是n^2做法了 只使用已经遍历过的点数目和当前子树中的点数目转移我们知道复杂度是n^2的 于是大胆猜测一波同一个节点为根 ...

  4. UICollectionViewController的用法1

    UICollectionView 和 UICollectionViewController 类是iOS6 新引进的API,用于展示集合视图,布局更加灵活,可实现多列布局,用法类似于UITableVie ...

  5. 【Android】Android自定义属性,attr format取值类型

    1. reference:参考某一资源ID. (1)属性定义: <declare-styleable name = "名称"> <attr name = &quo ...

  6. Python学习(十六)—— 数据库

    一.数据库介绍 数据库(Database,DB)是按照数据结构来组织.存储和管理数据的,并且是建立在计算机存储设备上的仓库. 数据库指的是以一定方式存储在一起.能为多个用户共享.具有尽可能小的冗余度. ...

  7. Linux安装Tomcat-Nginx-FastDFS-Redis-Solr-集群——【第九集之安装Tomcat+Nginx反向代理Tomcat集群】

    1,安装Tomcat:和在windows下安装是一样的. 安装tomcat:上传后解压: tar -zxvf apache-tomcat-7.0.88.tar.gz -z:代表.gz格式的压缩包,-x ...

  8. Ubuntu 硬盘分区只读,重新挂载为读写分区之后,文件依然创建出错

    原因: 分区只读,可能是windows没有正常关机,或者使用了混合休眠模式. 解决方案: sudo mount -o remount,rw /dev/sdaX 若重新挂载后,创建文件以及文件夹失败: ...

  9. 树莓派3 B+ 的串口(USART)使用问题

    转载:http://ukonline2000.com/?p=880 最新64位树莓派3已经发布快两周了,玩家们陆陆续续也开始使用上树莓派3了,随着玩家的增多,虽然拥有强大硬件配置的树莓派3也出现了各种 ...

  10. springboot配置log4j

    maven 配置jar包 <dependency> <groupId>org.springframework.boot</groupId> <artifact ...