Router(config)#ip access-list extended kz-80-oa Router(config-ext-nacl)#1000permit ip any any Router(config-ext-nacl)#exit Router(config)#do sh access-list Extended IP access list 100 10 deny udp host 10.1.1.1 host 20.1.1.3 eq domain 20 permit ip any any Extended IP access list kz-80-oa 1000 permit ip any any
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#ho core-1 core-1(config)#int range f0/1 - 2 core-1(config-if-range)#switchport trunk encapsulation dot1q core-1(config-if-range)#sw m t core-1(config-if-range)#exit core-1(config)#vtp mode server Device mode already VTP SERVER. core-1(config)#vtp domain d1 Changing VTP domain name from NULL to d1 core-1(config)#vtp password 123.com Setting device VLAN database password to 123.com core-1(config)#vlan 10 core-1(config-vlan)#exit core-1(config)#vlan 20 core-1(config-vlan)#exit core-1(config)#vlan 30 core-1(config-vlan)#exit core-1(config)#vlan 40 core-1(config-vlan)#exit
Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#ho sw1 sw1(config)#int f0/3 sw1(config-if)#sw m t
sw1(config-if)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up sw1(config-if)#exit sw1(config)#vtp mode client Setting device to VTP CLIENT mode. sw1(config)#vtp domain d1 Domain name already set to d1. sw1(config)#vtp password 123.com Setting device VLAN database password to 123.com sw1(config)#int f0/1 sw1(config-if)#sw ac vl 10 sw1(config-if)#exit sw1(config)#int f0/2 sw1(config-if)#sw ac vl 20 sw1(config-if)#exit sw1(config)#
core-1(config)#ip routing core-1(config)#int vlan 10 core-1(config-if)# %LINK-5-CHANGED: Interface Vlan10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up
core-1(config-if)#ip add 192.168.1.254 255.255.255.0 core-1(config-if)#no sh core-1(config-if)#exit core-1(config)#int vlan 20 core-1(config-if)# %LINK-5-CHANGED: Interface Vlan20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up
core-1(config-if)#ip add 192.168.2.254 255.255.255.0 core-1(config-if)#no sh core-1(config-if)#exit core-1(config)#int vlan 30 core-1(config-if)# %LINK-5-CHANGED: Interface Vlan30, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan30, changed state to up
core-1(config-if)#ip add 192.168.3.254 255.255.255.0 core-1(config-if)#no sh core-1(config-if)#exit core-1(config)#int vlan 40 core-1(config-if)# %LINK-5-CHANGED: Interface Vlan40, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan40, changed state to up
core-1(config-if)#ip add 192.168.4.254 255.255.255.0 core-1(config-if)#no sh core-1(config-if)#exit
三层交换机配置路由
1 2 3 4 5 6 7 8 9
core-1#conf t Enter configuration commands, one per line. End with CNTL/Z. core-1(config)#int f0/3 core-1(config-if)#no sw core-1(config-if)#ip add 172.16.1.1 255.255.255.0 core-1(config-if)#no sh core-1(config-if)#exit core-1(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.2
Router(config)#int f0/0 Router(config-if)#ip add 172.16.1.2 255.255.255.0 Router(config-if)#no sh Router(config-if)#exit
Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config)#int f0/1 Router(config-if)#ip add 100.1.1.1 255.255.255.0 Router(config-if)#no sh Router(config-if)# %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up Router(config-if)#exit Router(config)# %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up Router(config)#ip route 192.168.1.0255.255.255.0172.16.1.1 Router(config)#ip route 192.168.2.0255.255.255.0172.16.1.1 Router(config)#ip route 192.168.3.0255.255.255.0172.16.1.1 Router(config)#ip route 192.168.4.0255.255.255.0172.16.1.1 Router(config)#ip route 200.1.1.0255.255.255.0100.1.1.2
完成后全网互通,接下来配置ACL
ACL配置
销售部只能访问内网,只需要在三层交换机的虚拟网关上拦截入口流量,往内网转发的全部允许,其他的都干掉
1 2 3 4 5 6 7 8 9 10 11 12
core-1>en core-1#conf t Enter configuration commands, one per line. End with CNTL/Z. core-1(config)#int vlan 10 core-1(config-if)#ip access-list extended ctrl-10-intra core-1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 192.168.2.0 0.0.0.255 core-1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255 core-1(config-ext-nacl)#permit ip 192.168.1.0 0.0.0.255 192.168.4.0 0.0.0.255 core-1(config-ext-nacl)#exit core-1(config)#int vlan 10 core-1(config-if)#ip access-group ctrl-10-intra in core-1(config-if)#exit
core-1(config)#ip access-list extended ctrl-30-defend core-1(config-ext-nacl)#1000 permit ip any any core-1(config-ext-nacl)#10 deny ip 192.168.0.00.0.255.255192.168.3.00.0.0.255 core-1(config-ext-nacl)#exit core-1(config)#int vlan 30 core-1(config-if)#ip access-group ctrl-30-defend out core-1(config-if)#exit