路由控制-路由策略
实验需求:
1、配置IP地址。
2、全网运行OSPF 1。
3、要求市场部---财务部、研发部不能互访;公司总部---研发部不能互访。
4、验证:在主机上使用PING命令验证连通性。
具体配置:
RTA:
interface GigabitEthernet0/0/0
ip address 12.1.1.1 24
interface GigabitEthernet0/0/1
ip address 10.1.1.2 24
interface GigabitEthernet0/0/2
ip address 10.1.2.2 24
interface GigabitEthernet4/0/0
ip address 10.1.3.2 24
RTB:
interface GigabitEthernet0/0/0
ip address 12.1.1.2 24
interface GigabitEthernet0/0/1
ip address 12.1.2.1 24
interface GigabitEthernet0/0/2
ip address 12.1.3.1 24
RTC:
interface GigabitEthernet0/0/0
ip address 12.1.2.2 24
interface GigabitEthernet0/0/1
ip address 10.1.4.2 24
RTD:
interface GigabitEthernet0/0/0
ip address 12.1.3.2 24
interface GigabitEthernet0/0/1
ip address 10.1.5.2 24
RTA:
ospf 1
area 0.0.0.0
network 10.1.1.2 0.0.0.0
network 10.1.2.2 0.0.0.0
network 10.1.3.2 0.0.0.0
network 12.1.1.0 0.0.0.255
RTB:
ospf 1
area 0.0.0.0
network 12.1.1.0 0.0.0.255
network 12.1.2.0 0.0.0.255
network 12.1.3.0 0.0.0.255
RTC:
ospf 1
area 0.0.0.0
network 10.1.4.0 0.0.0.255
network 12.1.2.0 0.0.0.255
RTD:
ospf 1
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 12.1.3.0 0.0.0.255
配置完ospf之后,在市场部的终端上测试一下终端设备之间是否已经可以互相ping 通:ping+目的地址
- 要求市场部---财务部、研发部不能互访;公司总部---研发部不能互访。
(1)在RTC上将财务部和研发部的网段拒绝引入OSPF
ip ip-prefix 1 deny 10.1.1.0 24
ip ip-prefix 1 deny 10.1.2.0 24
ip ip-prefix 1 permit 0.0.0.0 0 less-equal 32 //表示允许所有,使得其他的OSPF路由不被缺省的拒绝所有拒绝掉
ospf 1
filter-policy ip-prefix 1 import //在OSPF进程使用filter-policy过滤路由,允许和拒绝动作在ACL/前缀列表中调用
(2)在RTD上将研发部的网段拒绝引入OSPF
acl number 2000
rule 5 permit source 10.1.2.0 0
route-policy 123 deny node 10
if-match acl 2000
route-policy 123 permit node 20//由于在route-policy中没有被任何节点匹配的路由会被缺省的拒绝节点拒绝掉所以需要一条空的允许节点允许其他路由通过
ospf 1
filter-policy route-policy 123 import
4、验证:在主机上使用PING命令验证连通性。
市场部:
公司总部:
可以看到,本来在做完ospf之后可以被市场部访问的财务部、研发部已经不能被访问了,而其他部门照样可以被访问。同理,看一下公司总部,总部除了研发部门以外,其他部门均可被访问。
——·扫描下方微信二维码,回复“实验手册”。即可领取完整电子版手册或为你答疑解惑。·——
|