目录
底层
switch
vlan 100,128,172
exit
int vlan 100
ip add 202.100.1.0 255.255.255.0
int vlan 128
ip add 61.128.1.100 255.255.255.0
int vlan 172
ip add 255.255.255.0
int g0/0
sw mo ac
sw ac vlan 100
int g0/1
sw mo ac
sw ac vlan 128
int g0/2
sw mo ac
sw ac vlan 172
ip dh poo v202
netw 202.100.1.0 /24
ip dh poo v128
netw 61.128.1.0 /24
ip dh poo v172
netw 172.9.1.0 /24
R1
int g0/0
ip add dhcp
int lo 0
ip add 10.1.1.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 200.100.1.100
R2
int g0/0
ip add dhcp
int lo 0
ip add 10.1.2.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 61.128.1.100
R3
int g0/0
ip add dhcp
int lo 0
ip add 10.1.3.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 172.9.1.100
建隧道
mGRE和NHRP配置
R1
int t0
ip add 10.1.123.1 255.255.255.0
tun sou g0/0
tun mode gre multipoint
ip nhrp netw 123
R2
int t0
ip add 10.1.123.2 255.255.255.0
ip nhrp netw 123
tun so g0/0
tun mo gre mu
ip nhrp nhs 10.1.123.1 nbma 202.100.1.1 //高版本
低版本
ip nhrp map 10.1.123.1 202.100.1.1
ip nhrp nhs 10.1.123.1
R3
int t0
ip add 10.1.123.3 255.255.255.0
ip nhrp netw 123
tun so g0/0
tun mo gre mu
ip nhrp nhs 10.1.123.1 nbma 202.100.1.1
测试
R1
R2
通过pingR3,在R1上学到去往R3的映射表项,之后R2可直接去往R3,不需要HUB中转
接入设备(lo 0)
eigrp
R1
int t0
ip nhrp map multicast dynamic
no ip split-horizon eigrp 90 关闭水平分割
no ip next-hop-self eigrp 90 关闭第三方下一跳
router eigrp 90
no au
netw 10.1.1.0 0.0.0.255
netw 10.1.123.0 0.0.0.255
R2
int t0
ip nhrp map multicast 202.100.1.1
router eigrp 90
no au
netw 10.1.2.0 0.0.0.255
netw 10.1.123.0 0.0.0.255
R3
int t0
ip nhrp map multicast 202.100.1.1
router eigrp 90
no au
netw 10.1.3.0 0.0.0.255
netw 10.1.123.0 0.0.0.255
tunnnel 0 接口 sh no sh 翻动一下
R1 t0上关闭了eigrp的第三方下一跳,R2,R3上去往对端的ip下一跳是从R1的映射上学习的
OSPF
Broadcast
R1
int t0
ip nhrp map mu dy
ip os netw broadcast //gre tunnel默认PTP,需要修改
router os 1
router-id 1.1.1.1
netw 10.1.1.0 0.0.0.255 a 0
netw 10.1.123.0 0.0.0.255 a 0
R2
int t0
ip nhrp map mu dy
ip os netw br
ip os prio 0 修改端口优先级,确保R1是DR
router os 1
router-id 2.2.2.2
netw 10.1.2.0 0.0.0.255 a 0
netw 10.1.123.0 0.0.0.255 a 0
R3
int t0
ip nhrp map mu dy
ip os netw br
ip os prio 0
router os 1
router-id 3.3.3.3
netw 10.1.3.0 0.0.0.255 a 0
netw 10.1.123.0 0.0.0.255 a 0
PTMP点到多点
R1
int t0
ip nhrp map mu dy
ip os netw point-to-mu
ip nhrp redirect
R2,R3
int t0
ip nhrp map mu 202.100.1.1
ip os netw p mu
ip nhrp shortcut 路径优化
加密
R1
crypto isa po 10
au pre
en 3des
group 2
ha sh
exit
crypto isa key cisco add 0.0.0.0
crypto ipsec tr TS esp-3 esp-sha-hmac
mod tun
crypto ipsec pr PRF
set tr TS
exit
int t0
tun proection ipsec PRF
R2
crypto isa po 10
au pre
en 3des
group 2
ha sh
exit
crypto isa key cisco add 202.100.1.1
crypto isa key cisco add 172.9.0.0 255.255.255.0.0
crypto ipsec tr TS esp-3 esp-sha-h
mod tun
crypto ipsec pr PRF
set tr TS
exit
int t0
tun proection ipsec PRF
R3
crypto isa po 10
au pre
en 3des
group 2
ha sh
exit
crypto isa key cisco add 202.100.1.1
crypto isa key cisco add 61.128.0.0 255.255.255.0.0
crypto ipsec tr TS esp-3 esp-sha-h
mod tun
crypto ipsec pr PRF
set tr TS
exit
int t0
tun proection ipsec PRF