Centos系统IPV4+IPV6配置

 每日运维   2021-12-18 16:36   51 人阅读  0 条评论

1.交换机侧IPV6配置

<GZDX-GZTH-CDN-SW5712>system-view              #系统视图
[GZDX-GZTH-CDN-SW5712]ipv6                     #全局ipv6转发
[GZDX-GZTH-CDN-SW5712]vlan batch 40 50         #创建vlan
[GZDX-GZTH-CDN-SW5712]interface Vlanif 40      #进入接口视图
[GZDX-GZTH-CDN-SW5712-Vlanif40]ip address 192.168.100.55 255.255.255.0
[GZDX-GZTH-CDN-SW5712-Vlanif40]ipv6 enable     #接口启用ipv6
[GZDX-GZTH-CDN-SW5712-Vlanif40]ipv6 address 2000::a561:47bd:e62f:386/120   #ip地址/前缀长度
[GZDX-GZTH-CDN-SW5712]port-group server        #创建端口组,server为组名可自定义
[GZDX-GZTH-CDN-SW5712-port-group-server1]group-member GigabitEthernet 2/0/25 to GigabitEthernet 2/0/28  #根据实际情况配置端口批量加入端口组
[GZDX-GZTH-CDN-SW5712-port-group-server1]port link-type access             #根据实际情况配置接口类型access、trunk
[GZDX-GZTH-CDN-SW5712-port-group-server1]port default vlan 40              #接口加入vlan,如trunk类型执行port trunk allow-pass vlan <vlan-name>

2.服务器bond配置

编辑bond网卡配置文件

vim /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BONDING_OPTS="mode=4 miimon=100 xmit_hash_policy=1"
TYPE=Bond
BONDING_MASTER=yes
BOOTPROTO=none
IPADDR=192.168.221.111
PREFIX=24
GATEWAY=192.168.221.221
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes             # IPV6是否自动初始化: 是                  
IPV6_AUTOCONF=no         # IPV6是否自动配置:否
IPV6ADDR=FC00::812:192:168:221:42/120   #ipv6地址/掩码长度
IPV6_DEFAULTGW=FC00::812:192:168:221:1  #配置ipv6网关
IPV6_DEFROUTE=yes        # IPV6是否可以为默认路由:
IPV6_PEERDNS=yes  
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no    # 是否开启IPV6致命错误检测:否
NAME=bond0        
ONBOOT=yes
MTU=9000

编辑slave网卡配置文件:

vim /etc/sysconfig/network-scripts/ifcfg-ens4f1
TYPE=Ethernet
NAME=ens4f1         #根据实际情况修改网卡名称
DEVICE=ens4f1       #根据实际情况修改网卡名称
ONBOOT=yes
MASTER=bond0        #指定本网卡的master为bond0网卡
SLAVE=yes           #是否为slave
本文地址:https://linux365.cn/post/53.html
版权声明:本文为原创文章,版权归 每日运维 所有,欢迎分享本文,转载请保留出处!

评论已关闭!