interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
access口:
trunk口:
interface GigabitEthernet0/0/2
port link-type trunk
port trunk pvid vlan 10
port trunk allow-pass vlan 10
hybrd口:
interface GigabitEthernet0/0/3
port link-type hybrid
port hybrid pvid vlan 10
port hybrid tagged vlan 20
port hybrid untagged vlan 10
查询命令:
dis port vlan active
dis port vlan
子接口配置:
interface GigabitEthernet0/0/0.10
dot1q termination vid 10
ip address 1.1.1.1 255.255.255.0
arp broadcast enable
BGP协议基于TCP,端口为179
VPN相关:
端口绑定vpn实例:(绑定实例之后需要重新配置端口ip)
ip binding vpn-instance vpnb
查看vpn绑定信息:
dis ip vpn-instance interface
查看vpn路由表:
dis ip routing-table vpn-instance vpna
带vpn标签进行ping:
ping -v vpna 10.1.5.1
查看vpnv4 邻居:
dis bgp vpnv4 all peer
边界路由(PE设备)需要配置:
bgp 100
peer 10.1.3.3 as-number 100
peer 10.1.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.1.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 10.1.3.3 enable
#
ipv4-family vpn-instance vpna
network 192.168.1.0
network 192.168.2.0
路由反射器RR需要配置:
bgp 100
peer 10.1.1.1 as-number 100
peer 10.1.1.1 connect-interface LoopBack0
peer 10.1.5.5 as-number 100
peer 10.1.5.5 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 10.1.1.1 enable
peer 10.1.1.1 reflect-client
peer 10.1.5.5 enable
peer 10.1.5.5 reflect-client
#
ipv4-family vpnv4
#需要undo掉下面这句
undo policy vpn-target
peer 10.1.1.1 enable
peer 10.1.1.1 reflect-client
peer 10.1.5.5 enable
peer 10.1.5.5 reflect-client
MPLS VPN配置思路:
- 首先配置IGP,使用isis配置
- 配置MPLS LDP,首先配置mpls lsr-id,然后全局使能mpls ldp,然后各个互联接口上配置mpls ldp
- 配置IGP,使用路由反射器,在环回接口上建立,并检查IGP路由是否正确传递
- 路由反射器RR设备上进入vpnv4簇,对PE对等体进行enable,并且设置PE对等体为reflect-client
- 边界路由(PE)设备上进入vpnv4簇,对RR对等体进行enable
- 边界路由PE设备,配置vpn实例,设置RD、RT
- 在相应端口上绑定VPN实例(需重新设置IP)
- 在边界路上进入vpn-instance簇,使用net引入相关路由
- 在其他PE、RR设备上查看引入的路由是否有效且最优化
MPLS解决BGP路由黑洞问题:
#在边界路由(PE)上开启
route recursive-lookup tunnel
ISIS与动态BFD联动:
#
bfd
#
isis 1
is-level level-2
bfd all-interfaces enable
network-entity 10.0000.0000.0001.00
#
interface GigabitEthernet2/0/0
ip address 10.3.3.1 255.255.255.0
isis enable 1
isis cost 5
isis bfd enable
isis bfd min-tx-interval 100 min-rx-interval 100 detect-multiplier 4
BFD与静态路由联动:
#1为bfd的名称discriminator local要和对端相反
bfd 1 bind peer-ip 10.0.37.7 vpn-instance 65110PSIS
discriminator local 33
discriminator remote 77
min-tx-interval 300
min-rx-interval 300
commit
#绑定BFD到相关端口上
ip route-s vpn-instance 65110PSIS 172.168.0.0 24 10.0.37.7 track bfd-session 1
VRRP配置:
interface GigabitEthernet0/0/0.10
vrrp vrid 1 virtual-ip 10.1.1.111
vrrp vrid 1 priority 120 #设备在VRRP备份组中的优先级缺省为100,修改Master设备的优先级大于Backup设备
vrrp vrid 1 preempt-mode timer delay 20 #设备在VRRP备份组中缺省采用立即抢占方式。修改Master设备的延迟抢占时间,以避免在网络环境不稳定时,由于双方频繁抢占而导致流量中断的问题
#在终结子接口下,需要额外配置一条:
dot1q vrrp vid 10
链路聚合(需要端口空状态下配置):
int Eth-Trunk 1
trunkport g 0/0/1
mode lacp-static
dis eth-trunk
MSTP配置:
stp mode mstp
stp region-configuration
region-name huawei
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#以上代码,所有交换机必须一致
#以下代码,根据实际情况配置
#指定实例1为主根,实例2为附根
stp instance 1 root primary
stp instance 2 root secondary
#查看MSTP状态
dis mstp b
路由策略:
#第一步,先创建前缀列表:
ip ip-prefix 1 permit 192.168.1.0 24
#第二步,创建路由策略:
#阻止ip-perfix 1 的路由
route-policy 1 deny node 10
if-match ip-prefix 1
#放行所有路由
route-policy 1 permit node 20
#将路由策略应用到BGP上
import-route direct route-policy 1
telnet配置:
user-interface vty 0 4
authentication-mode aaa
aaa
local-user huawei password simple 123
local-user huawei privilege 15
local-user huawei service-type telnet
配置telnet访问限制(acl):
acl number 2000
rule permit source 192.168.2.0 0.0.0.255
user-interface vty 0 4
acl 2000 inbound
ISIS相关:
#始终发布缺省路由
default-route-advertise always