LInux学习笔记 --网桥&IPV6

时间:2024-04-06 09:49:58


#网桥#


#实验前#


LInux学习笔记 --网桥&IPV6


#一.配置#


 

[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-enp0s25

DEVICE=enp0s25 ##设备名称

ONBOOT=yes ##开启服务设备自动**

BOOTPROTO=none ##网卡工作状态

BRIDGE=br0 ##网卡开启的网桥接口

 LInux学习笔记 --网桥&IPV6


[[email protected] ~]# vim /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0

ONBOOT=yes

BOOTPROTO=none

IPADDR=172.25.254.66

NETMASK=255.255.255.0

TYPE=Bridg ##网络接口类型是桥接

 LInux学习笔记 --网桥&IPV6


[[email protected] ~]# systemctl stop NetworkManager.service

[[email protected] ~]# systemctl restart network

[[email protected] ~]# systemctl start NetworkManager.service

[[email protected] ~]# ifconfig

 

 

【测试】

[[email protected] ~]# virt-manager

--安装虚拟机

--Network install(HTTP,FTP,or NFS)

--URL:yum源

--Forward *3

--Finish

 

 

#二.命令管理方式#


 

##实验前删除和之前配置的team0

[[email protected] Desktop]# nmcli connection delete time0

[[email protected] Desktop]# nmcli connection delete eth0

[[email protected] Desktop]# nmcli connection delete eth1

 LInux学习笔记 --网桥&IPV6


#1.添加#

[[email protected] Desktop]# systemctl stop NetworkManager

[[email protected] Desktop]# brctl show

[[email protected] Desktop]# brctl addbr br0

[[email protected] Desktop]# brctl addif br0 eth0

[[email protected] Desktop]# ifconfig eth0 up

[[email protected] Desktop]# ifconfig br0 172.25.254.129 netmask 255.255.255.0

[[email protected] Desktop]# brctl show

[[email protected] Desktop]# ping 172.25.254.66

 LInux学习笔记 --网桥&IPV6


#2.删除#

[[email protected] Desktop]# ifconfig br0 down

[[email protected] Desktop]# brctl delif br0 eth0

[[email protected] Desktop]# brctl delbf br0

[[email protected] Desktop]# brctl show

 LInux学习笔记 --网桥&IPV6


 

#ipv6(Internet Proto version 6)#


#一.概述#

ipv4 32/2 地址枯竭 子网掩码 24 16 8

ipv6 128/2 子网掩码 16 32 48 64 80

128/2 ---> 128/8 -> 16 ---> (IP地址表达)0-f

eg:2017:0:0:0:f:0:0:1/48

 

#二.配置#

 

[[email protected] Desktop]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

IPADDR=172.25.254.129

NETMASK=255.255.255.0

IPV6INIT=yes ##ipv6功能开启

IPV6_AUTOCONF=no ##IP为静止的

IPV6ADDR=2017::e:f/64 ##设置的IP

LInux学习笔记 --网桥&IPV6

#三.测试#

LInux学习笔记 --网桥&IPV6