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 ...
随机推荐
- .net remoting(1)简单例子
1.例子(程序间的通讯) class Program { static void Main(string[] args) { HttpChannel _channel = ); ChannelServ ...
- curl请求https请求
function curl_https($url,$data){ $ch = curl_init (); curl_setopt ( $ch, CURLOPT_URL, $url ); curl_se ...
- eclipse4.2版本下面安装ADT,安装已经完成了,但没有ADT的那个图标显示
如果安装过程没错,直接在Eclipse ->window->customize Perpective->Command Groups Availability 勾选andorid 选 ...
- Spring AOP中args()、arg-names、argNames
先小结一下: args()是用来匹配并且接收目标方法的参数的. argNames(用在注解中)与arg-names(用在XML中),他们是同一个东西. argNames用来接收AspectJ表达式中的 ...
- 事件(Event)(onclick,onchange,onload,onunload,onfocus,onblur,onselect,onmuse)【转载】
ylbtech-Event:事件(Event)对象 事件(Event) HTML 4.0 事件属性 onclick onchange onload onunload onselect onmouse ...
- 数位dp 模板
不能有49 #include<bits/stdc++.h> using namespace std; //input by bxd #define rep(i,a,b) for(int i ...
- 工具Maven
Maven 1.使用Maven后每个jar包只在本地仓库中保存一份,需要jar包的工程只需要维护一个文本形式的jar包的引用——我们称之为“坐标”. 2.Maven就可以替我们自动的将当前jar包所依 ...
- 046 Oracle执行慢的SQL
-- 执行最慢的sql SELECT * FROM (SELECT sa.SQL_TEXT, sa.SQL_FULLTEXT, sa.EXECUTIONS as "exeCount" ...
- day 52 dom 事件
本文转载自cnblog.liwenzhou.com 官网资料: http://www.w3school.com.cn/htmldom/dom_methods.asp 事件的内容很重要的,基本概念有点类 ...
- element-ui upload组件上传
方法一: <el-table-column label="操作"> <template slot-scope="scope"> < ...