Linux--以太网的了解

目录

Linux的三种网络连接方式

Linux上的ens33网络信息说明

 Linux上修改临时ip地址的操作

 Linux上改临时ip地址


Linux的三种网络连接方式

VMnet0:这是VMware用于虚拟桥接网络下的虚拟交换机;

VMnet1:这是VMware用于虚拟Host-Only网络下的虚拟交换机;

VMnet8:这是VMware用于虚拟NAT网络下的虚拟交换机;

VMware Network Adapter VMnet1:这是Host用于与Host-Only虚拟网络进行通信的虚拟网卡;

VMware Network Adapter VMnet8:这是Host用于与NAT虚拟网络进行通信的虚拟网卡;

仅主机:

建立虚拟机与主机之间的通信

NAT:

建立虚拟机与外网的通信

桥接:

将虚拟机的网络独立出来与主机平起平坐,共同连接在同一台交换机上,这样虚拟机对物理机的直接影响较小

Linux上的ens33网络信息说明

[root@xuegod63 ~]# ifconfig 
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.63  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::c09d:975d:89cd:fd3f  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:02:83:db  txqueuelen 1000  (Ethernet)
        RX packets 3255  bytes 4458479 (4.2 MiB)
        RX errors 0  dropped 26  overruns 0  frame 0
        TX packets 1130  bytes 81645 (79.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

上图信息大概说明:
第一行:up-->网卡开启状态
		RUNNING-->网线处理连接状态
		MULTICAST-->支持组播
		mtu 1500-->(Maximum Transmission Unit)最大传输单元大小为1500字节
第二行:该网卡的IP地址,子网掩码,广播地址
第三行:IPV6的配置信息
第四行:网卡的MAC地址
		ether表示连接类型为以太网
		txqueuelen 1000 --》传输队列的长度
第五六行:网卡接收数据包的统计信息和接收错误的统计信息
第七八行:网卡发送数据包的统计信息和发送错误的统计信息

 Linux上修改临时ip地址的操作

ifconfig		//看当前网络ip地址
ifconfig ens33 192.168.39.110 netmask 255.255.255.0
				//添加临时ip
ifconfig ens33:0 del 192.168.1.110
				//删除临时ip
systemctl restart network
				//CentOS7网卡重启的方法

 Linux上改临时ip地址

[root@localhost chen]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.39.129  netmask 255.255.255.0  broadcast 192.168.39.255
        inet6 fe80::5566:ba43:5af8:3853  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:38:ec:30  txqueuelen 1000  (Ethernet)
        RX packets 1183  bytes 842885 (823.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 419  bytes 41660 (40.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.146.129  netmask 255.255.255.0  broadcast 192.168.146.255
        inet6 fe80::be6f:2dc3:488f:9984  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:38:ec:3a  txqueuelen 1000  (Ethernet)
        RX packets 53  bytes 5711 (5.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 93  bytes 13888 (13.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens35: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:0c:29:38:ec:44  txqueuelen 1000  (Ethernet)
        RX packets 3  bytes 747 (747.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        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 1000  (Local Loopback)
        RX packets 64  bytes 5568 (5.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5568 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:d6:40:7b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost chen]# ifconfig ens33 192.168.39.110 netmask 255.255.255.0
[root@localhost chen]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.39.110  netmask 255.255.255.0  broadcast 192.168.39.255
        inet6 fe80::5566:ba43:5af8:3853  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:38:ec:30  txqueuelen 1000  (Ethernet)
        RX packets 1193  bytes 843485 (823.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 434  bytes 45124 (44.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost chen]# systemctl restart network
[root@localhost chen]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.39.129  netmask 255.255.255.0  broadcast 192.168.39.255
        inet6 fe80::5566:ba43:5af8:3853  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:38:ec:30  txqueuelen 1000  (Ethernet)
        RX packets 1208  bytes 845228 (825.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 468  bytes 50252 (49.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值