从2019年6月份开始学习网络,最主要的驱动力是一旦涉及网络配置的改动都需要找别人帮忙,有时候被别人找理由拖延或者拒绝,心里就会难过,不就是配置一些代码吗?!这和写程序有多大的区别?!以前追求的一直是合格的程序员,但是合格的程序员也不能受限于这部分的知识和技能了,应该学习网络知识。
学进去后才觉得这里面的东西可是真多,做一名合格的网络工程师绝不容易!!!
那时主要的学习途径是在网络上找资料学习,很长时间没有真机操作,主要原因是没有多余的网络设备,不能拿正常运行的设备去做试验。
到2020年的时候,公司需要替换网络设备,就是将思科产品全部替换为H3C的产品,我感觉真机操练的机会来了,本来公司请的是网工祁国军来操作,我就和他商量,主要的配置我来做,不会的我请教,他答应了。那次比较顺利就完成了任务,感觉自己入了门,但是祁老师配置了OSPF,这一部分我没有操作。
后面网络一直没有问题,也没有动力去进一步去学习网络了。
这次使用eNSP组网试验,方便了实操训练,主要是可以练习和掌握很多基础知识。
前面练习了Vlan和静态路由,昨天开始练习OSPF。
上面模拟了一个公司比较真实的场景。
⑴路由器与交换机之间有的是trunk,有的access;
⑵在路由器(三层交换机)上直接连终端;
⑶汇聚部分有的在路由器,有的在三层交换机;
⑷一般情况下,一个公司在一个区域里,也可以按地域或者下属单位来划分多区域。
在网络上的教程或者视频中,绝大部分都是拿路由器来做模拟OSPF区域讲解,绝少有交换机参与,这让人认为OSPF很简单。在eNSP中只有S5700、S3700两款交换机,它们都不能在端口上加地址,这给我带来了困惑,难道eNSP这么先进的工具,这部分的功能欠缺吗?以华为那么硬的实力不可能没有考虑这部分的需求。
经过反复试验,解决了困惑。
主要配置:
①R1的配置:
- #
- sysname R1
- #
- undo info-center enable
- #
- vlan batch 10 20 200
- #
- aaa
- authentication-scheme default
- authorization-scheme default
- accounting-scheme default
- domain default
- domain default_admin
- local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
- local-user admin service-type http
- #
- firewall zone Local
- priority 16
- #
- interface Vlanif10
- ip address 172.16.240.1 255.255.255.0
- #
- interface Vlanif20
- ip address 172.16.241.1 255.255.255.0
- #
- interface Vlanif200
- ip address 192.168.10.1 255.255.255.0
- #
- interface Ethernet0/0/0
- portswitch
- port link-type trunk
- port trunk allow-pass vlan 2 to 4094
- #
- interface Ethernet0/0/1
- ip address 192.168.11.2 255.255.255.0
- #
- interface Serial0/0/0
- link-protocol ppp
- #
- interface Serial0/0/1
- link-protocol ppp
- #
- interface Serial0/0/2
- link-protocol ppp
- #
- interface Serial0/0/3
- link-protocol ppp
- #
- interface GigabitEthernet0/0/0
- #
- interface GigabitEthernet0/0/1
- #
- interface GigabitEthernet0/0/2
- #
- interface GigabitEthernet0/0/3
- #
- wlan
- #
- interface NULL0
- #
- ospf 1
- area 0.0.0.1
- network 192.168.11.2 0.0.0.0
- network 192.168.10.2 0.0.0.0
- network 1.1.1.0 0.0.0.255
- network 172.16.240.0 0.0.0.255
- network 172.16.241.0 0.0.0.255
- #
- user-interface con 0
- user-interface vty 0 4
- user-interface vty 16 20
- #
- return
②R5的配置:
- #
- sysname R5
- #
- undo info-center enable
- #
- vlan batch 30 40 300
- #
- aaa
- authentication-scheme default
- authorization-scheme default
- accounting-scheme default
- domain default
- domain default_admin
- local-user admin password cipher OOCM4m($F4ajUn1vMEIBNUw#
- local-user admin service-type http
- #
- firewall zone Local
- priority 16
- #
- interface Vlanif300
- #
- interface Ethernet0/0/0
- ip address 192.168.14.3 255.255.255.0
- #
- interface Ethernet0/0/1
- ip address 192.168.15.2 255.255.255.0
- #
- interface Serial0/0/0
- link-protocol ppp
- #
- interface Serial0/0/1
- link-protocol ppp
- #
- interface Serial0/0/2
- link-protocol ppp
- #
- interface Serial0/0/3
- link-protocol ppp
- #
- interface GigabitEthernet0/0/0
- #
- interface GigabitEthernet0/0/1
- #
- interface GigabitEthernet0/0/2
- #
- interface GigabitEthernet0/0/3
- #
- wlan
- #
- interface NULL0
- #
- ospf 1
- area 0.0.0.1
- network 192.168.14.3 0.0.0.0
- network 192.168.15.2 0.0.0.0
- network 172.16.172.0 0.0.0.255
- network 172.16.173.0 0.0.0.255
- #
- user-interface con 0
- user-interface vty 0 4
- user-interface vty 16 20
- #
- return
③交换机PSP-A的配置:
- #
- sysname PSP-A
- #
- undo info-center enable
- #
- vlan batch 10 20 200
- #
- cluster enable
- ntdp enable
- ndp enable
- #
- drop illegal-mac alarm
- #
- diffserv domain default
- #
- drop-profile default
- #
- aaa
- authentication-scheme default
- authorization-scheme default
- accounting-scheme default
- domain default
- domain default_admin
- local-user admin password simple admin
- local-user admin service-type http
- #
- interface Vlanif1
- #
- interface Vlanif10
- ip address 172.16.240.19 255.255.255.0
- #
- interface Vlanif20
- ip address 172.16.241.19 255.255.255.0
- #
- interface Vlanif200
- ip address 192.168.10.19 255.255.255.0
- #
- interface MEth0/0/1
- #
- interface GigabitEthernet0/0/1
- port link-type trunk
- port trunk allow-pass vlan 2 to 4094
- #
- interface GigabitEthernet0/0/2
- port link-type trunk
- port trunk allow-pass vlan 2 to 4094
- #
- interface GigabitEthernet0/0/3
- port link-type trunk
- port trunk allow-pass vlan 2 to 4094
- #
- interface GigabitEthernet0/0/4
- port link-type access
- port default vlan 200
- #
- interface GigabitEthernet0/0/5
- #
- interface GigabitEthernet0/0/6
- #
- interface GigabitEthernet0/0/7
- #
- interface GigabitEthernet0/0/8
- #
- interface GigabitEthernet0/0/9
- #
- interface GigabitEthernet0/0/10
- #
- interface GigabitEthernet0/0/11
- #
- interface GigabitEthernet0/0/12
- #
- interface GigabitEthernet0/0/13
- #
- interface GigabitEthernet0/0/14
- #
- interface GigabitEthernet0/0/15
- #
- interface GigabitEthernet0/0/16
- #
- interface GigabitEthernet0/0/17
- #
- interface GigabitEthernet0/0/18
- #
- interface GigabitEthernet0/0/19
- #
- interface GigabitEthernet0/0/20
- #
- interface GigabitEthernet0/0/21
- #
- interface GigabitEthernet0/0/22
- #
- interface GigabitEthernet0/0/23
- #
- interface GigabitEthernet0/0/24
- #
- interface NULL0
- #
- ospf 1
- area 0.0.0.1
- network 172.16.240.0 0.0.0.255
- network 172.16.241.0 0.0.0.255
- network 192.168.10.0 0.0.0.255
- #
- ip route-static 0.0.0.0 0.0.0.0 192.168.11.2
- #
- user-interface con 0
- user-interface vty 0 4
- #
- return
④交换机PSP-B的配置
- dis cu
- #
- sysname PSP-B
- #
- undo info-center enable
- #
- vlan batch 30 40 300
- #
- cluster enable
- ntdp enable
- ndp enable
- #
- drop illegal-mac alarm
- #
- diffserv domain default
- #
- drop-profile default
- #
- aaa
- authentication-scheme default
- authorization-scheme default
- accounting-scheme default
- domain default
- domain default_admin
- local-user admin password simple admin
- local-user admin service-type http
- #
- interface Vlanif1
- #
- interface Vlanif30
- ip address 172.19.172.19 255.255.255.0
- #
- interface Vlanif40
- ip address 172.19.173.19 255.255.255.0
- #
- interface Vlanif300
- ip address 192.168.15.1 255.255.255.0
- #
- interface MEth0/0/1
- #
- interface GigabitEthernet0/0/1
- port link-type access
- port default vlan 300
- #
- interface GigabitEthernet0/0/2
- port link-type trunk
- port trunk allow-pass vlan 30
- #
- interface GigabitEthernet0/0/3
- port link-type trunk
- port trunk allow-pass vlan 40
- #
- interface GigabitEthernet0/0/4
- port link-type access
- port default vlan 300
- #
- interface GigabitEthernet0/0/5
- #
- interface GigabitEthernet0/0/6
- #
- interface GigabitEthernet0/0/7
- #
- interface GigabitEthernet0/0/8
- #
- interface GigabitEthernet0/0/9
- #
- interface GigabitEthernet0/0/10
- #
- interface GigabitEthernet0/0/11
- #
- interface GigabitEthernet0/0/12
- #
- interface GigabitEthernet0/0/13
- #
- interface GigabitEthernet0/0/14
- #
- interface GigabitEthernet0/0/15
- #
- interface GigabitEthernet0/0/16
- #
- interface GigabitEthernet0/0/17
- #
- interface GigabitEthernet0/0/18
- #
- interface GigabitEthernet0/0/19
- #
- interface GigabitEthernet0/0/20
- #
- interface GigabitEthernet0/0/21
- #
- interface GigabitEthernet0/0/22
- #
- interface GigabitEthernet0/0/23
- #
- interface GigabitEthernet0/0/24
- #
- interface NULL0
- #
- ospf 1
- area 0.0.0.1
- network 172.19.172.0 0.0.0.255
- network 172.19.173.0 0.0.0.255
- network 192.168.15.0 0.0.0.255
- #
- ip route-static 0.0.0.0 0.0.0.0 192.168.15.2
- #
- user-interface con 0
- user-interface vty 0 4
- #
- return
上面的试验是全部通过了测试,全网通。
OSPF的多区域与单区域的实际操作最大的一点区别就是配置多个area。