Cisco L3 vlan and route configuration, cisco L3 vlan
Cisco layer-3 vlan and route configuration. Requires that the entire network can access the Internet and use NAT Translation
1. Use an Internet router to simulate a public route. The configuration is as follows:
Router> enable
Router # config t
Enter configurationcommands, one per line. End with CNTL/Z.
Router (config) # inters1/0
Router (config-if) # ipadd 1.1.1.1 255.255.255.0
Router (config-if) # clockrate 6400
Router (config-if) # noshutdown
The public network router is configured.
2. Configure an enterprise Router
Configure the interface IP address connected to the public network to define the interface as outside
Router> enable
Router # config t
Enter configurationcommands, one per line. End with CNTL/Z.
Router (config) # inters1/1
Router (config-if) # ipadd 1.1.1.2 255.255.255.0
Router (config-if) # noshutdown
Router (config-if )#
% LINK-5-CHANGED: Interface Serial1/1, changed state to up
% LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
Router (config-if) # ip nat outside
Configure the IP address of the layer-3 Switch to define the interface as inside
Router (config) # interf0/0
Router (config-if) # ipadd 172.16.1.2 255.255.255.0
Router (config-if) # noshutdown
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-if) # ip nat inside
Configure the acl access control list, and do not configure access failure to access the public network through the route (this is particularly important ).
If the CIDR block that allows access to the public network is configured to allow access, the router will block these CIDR blocks from accessing the public network.
Router (config) # access-list10 permit 192.168.1.0 0.0.255
Router (config) # access-list10 permit 192.168.2.0 0.0.255
Router (config) # access-list10 permit 192.168.3.0 0.0.255
Configure NAT address translation
Router (config) # ip natinside source list 10 interface s1/1 overload
3. configure a layer-3 Switch
Create a vlan5 address for configuring the connection with the route, and insert f0/1 into the vlan5
Switch (config) # vlan 5
Switch (config) # interf0/1
Switch (config-if) # swit
Switch (config-if) # switchportmo
Switch (config-if) # switchportmode acc
Switch (config-if) # switchportmode access
Switch (config-if) # swac
Switch (config-if) # swaccess vlan 5
Configure vlan addresses
Switch (config-if) # intervlan 5
Switch (config-if )#
% LINK-5-CHANGED: Interface Vlan5, changed state to up
% LINEPROTO-5-UPDOWN: Line protocol on Interface VLAN 5, changed state to up
Switch (config-if) # ipadd 172.16.1.1 255.255.255.0
Switch (config-if) # noshutdown
Configure other VLANs as well
Configure Vlan2
Switch (config) # interf0/2
Switch (config-if) # swmo acc
Switch (config-if) # swacc vlan 2
Switch (config-if) # intervlan 2
Switch (config-if )#
% LINK-5-CHANGED: Interface Vlan2, changed state to up
% LINEPROTO-5-UPDOWN: Line protocol on Interface VLAN 2, changed state to up
Switch (config-if) # ipadd 192.168.1.254 255.255.255.0
Switch (config-if) # noshut
Switch (config-if )#
Configure Vlan3
Switch (config-if) # noshut
Switch (config-if) # interf0/3
Switch (config-if) # swmo acc
Switch (config-if) # swacc vlan 3
Switch (config-if) # intervlan 3
Switch (config-if )#
% LINK-5-CHANGED: Interface Vlan3, changed state to up
% LINEPROTO-5-UPDOWN: Line protocol on Interface VLAN 3, changed state to up
Switch (config-if) # ipadd 192.168.2.254 255.255.255.0
Configure Vlan4
Switch (config-if) # interf0/4
Switch (config-if) # swmo acc
Switch (config-if) # swacc vlan 4
Switch (config-if) # intervlan 4
Switch (config-if )#
% LINK-5-CHANGED: Interface Vlan4, changed state to up
% LINEPROTO-5-UPDOWN: Line protocol on Interface VLAN 4, changed state to up
Switch (config-if) # ipadd 192.168.3.254 255.255.255.0
Configure DHCP server
Configure vlan2DHCP Server
Switch (config) # ipdhcp pool vlan2
Switch (dhcp-config) # default-router192.168.1.254
Switch (dhcp-config) # dns-server1.1.1.1
Switch (dhcp-config) # network192.168.1.0 255.255.255.0
Switch (dhcp-config) # exit
Configure the vlan3DHCP Server
Switch (config) # ipdhcp pool vlan3
Switch (dhcp-config) # default-router192.168.2.254
Switch (dhcp-config) # dns-server2.2.2.2
Switch (dhcp-config) # network192.168.2.0 255.255.255.0
Switch (dhcp-config) # exit
Configure the vlan4DHCP Server
Switch (config) # ipdhcp pool vlan4
Switch (dhcp-config) # default-router192.168.3.254
Switch (dhcp-config) # dns-server3.3.3.3
Switch (dhcp-config) # network192.168.3.0 255.255.255.0
Switch (dhcp-config) # exit
Enable layer-3 Switch Routing
Ip routing
Computers in all VLANs can ping each other, but they still cannot access the Internet, because the routes are not
Configuration complete