目录
模拟器:GNS3
涉及双机热备知识及相关配置:
(47条消息) 双机热备技术(讲解+实验)——静态路由实现_孤城286的博客-CSDN博客

①合理规划 IP、网段、vlan
② 所有 交换机之间封装trunk
③配置vtp模式同步vlan数据库
④终端接口划分vlan
⑤双机热备配置
⑥生成树配置
⑦核心交换机配置 DHCP 地址池为总公司终端设备下发 ip 地址及网关
⑧pc1、pc2、SV-1互相ping测试验证是否以上配置成功
⑨路由处理:
sw1有两个OSPF邻居(一个直接和R7建立,一个通过互联vlan 12和 sw2 建立),sw2、R7同样也如此。
同时sw1和sw2要将vlan 10、20、30的三个网段的路由通告出去
R7作为互联网出口设备要在OSPF里面强制给sw1和sw2通告缺省路由,
sw1和sw2通过这个缺省路由才能访问互联网
同时R7需要配置静态缺省下一跳扔给R8(运营商和互联网出口路由器跑静态路由)
R11需要配置静态缺省路由:
ip route 0.0.0.0 0.0.0.0 141.1.1.14
R14需要配置pc3回来的路由:
ip route 113.1.1.0 255.255.255.0 141.1.1.11
R9和sw2之间跑OSPF(R9可以学习到vlan 10、20、30、互联网的路由)
因为核心交换机不知道去往P3的路由,所以需要把R9去往PC3的静态路由重分发进OSPF里(重分发外部路由默认cost值=20)。
- DHCP:
-
- 3560(config)#ip dhcp pool vlan10 ——为地址池设置名称(一般一个vlan对于一个地址池)
- 3560(dhcp-config)#default-router 192.168.20.254 ——为下发的地址设置网关
- 3560(dhcp-config)#network 192.168.20.0 255.255.255.0 ——设置下发地址范围
- 3560(dhcp-config)#dns-server 8.8.8.8 设置DNS
- ip dhcp excluded 192.168.100.254 ——excluded:排除其他的IP地址,防止冲突
- ip dhcp excluded 192.168.100.1
- ip dhcp excluded 192.168.100.2
- 3560(dhcp-config)#lease 1 (设备IP地址租期的时间默认24小时,单位为/天)
- exit
- show ip dhcp pool
-
- 终端:
- int f0/0
- ip add dhcp ——获取ip地址方式为dhcp
- ex
- show run int f0/0 ——查看接口详细信息
- show ip int br ——查看接口ip
- VTP通告:
-
- vlan database --进入到vlan数据库
- vtp domain aaa----定义一个domain域
- vtp password bbb---需要一个密码、密钥来认证
- vtp mode client---模式
-
- show vtp status-------查看指令
- OSPF:
-
- (1)OSPF area:区域,骨干区域0,其余非骨干区域
- router ospf 100---进入ospf路由协议的进程里,100为进程号
- router-id 1.1.1.1 ---指定router-id为(路由器在OSPF网络里的标识)
- network 10.1.1.0 0.0.0.255 area 0----将直连网段宣告area区域0(区域0为骨干区域,其余的为非骨干区域)
- default-information originate always ---强制下发缺省路由 OE2*(强制给所有ospf邻居通告缺省路由)
- redistribute static subnets---重分发静态路由,subnets掩码
- passive-interface vlan 10 --接口处于被动状态,让vlan 10接口只收不发hello包,不让其建立ospf邻居
- exit
- show ip ospf nei----查看ospf邻居
- sh run | s r o--查看所有ospf所有配置
- ping 4.4.4.4 source 1.1.1.1 --从我的1.1.1.1 ping 4.4.4.4
-
- int f0/3
- ip ospf cost 30
- exit
- PAT:
-
- R1(config)#int f0/1
- R1(config-if)#ip nat outside
- R1(config-if)#exit
- R1(config)#int f0/0
- R1(config-if)#ip nat inside
- R1(config-if)#exit
- R1(config)#access-list 1 permit 10.1.1.0 0.0.0.255
- R1(config)#access-list 1 permit 10.1.2.0 0.0.0.255
- R1(config)#ip nat inside source list 1 int f0/1 overload
- R1(config)#show ip nat translations (查看NAT转换)
- VRRP配置:
-
- (默认开启抢占功能)
- SW1(config)#track 1 interface f0/0 line-protocol
- 定义一个跟踪策略,这个策略名字是1,跟踪F0/0接口的状态信息
-
- SW1(config)#int vlan 10
- SW1(config-if)#ip address 192.168.10.11 255.255.255.0
- SW1(config-if)#vrrp 10 ip 192.168.10.254 //定义一个虚拟的IP地址,作为VLAN 10的网关
- SW1(config-if)#vrrp 10 priority 101 //定义一个优先级
- SW1(config-if)#vrrp 10 track 1 decrement 50 //调用track1优先级降低50--hsrp 10 track f0/0 50
- SW1(config-if)#vrrp 10 preempt delay minimum 0 --hsrp 10 pree
- SW1(config-if)#exit
- 查看vrrp信息:show vrrp brief
- ————链路捆绑
-
- int range f0/1 , f0/2
- channel-group 1 mode on
- exit
-
- int port-channel 1
- sw tr en dot
- sw mode tr
- exit
- 相关查看命令:
-
- show standby brief
- show spanning-tree vlan 10 nrief
- show cdp nei
- show vlan-sw
- show int trunk
- show ip route
- show int vlan 10
- show ip int brief
- show vrrp brief
- 生成树配置:
-
- spanning-tree vlan 10 root primary ——主根桥
- spanning-tree vlan 10 root secondary ——备份根桥
- 接口划vlan :
-
- Switch(config)#interface f0/1
- Switch(config-if)#switch mode access
- Switch(config-if)#switch access vlan 10
- Switch(config-if)#exit
-