Comprehensive layer-3 Switch configuration instances

Source: Internet
Author: User

 

Enable // enter private Mode

Configure terminal // enter global Mode

Service password-encryption // encrypt the password

Hostname Catalyst 3550-12T1 // define the name for the layer-3 Switch

Enable password 123456. // enable password

Enable secret 654321 // The encryption password of enable (it should be garbled, not 654321)

Ip subnet-zero // allow all 0 subnets (enabled by default)

Ip name-server 172.16.8.1 172.16.8.2 // the Ip address of the layer-3 Switch name Catalyst 3550-12T1 is 172.16.8.1.

Service dhcp // provides the DHCP Service

Ip routing // enable the routing module on the layer-3 Switch

 

Exit

Vtp mode server // defines VTP working mode as sever mode

Vtp domain centervtp // define the name of The VTP domain as centervtp

Vlan 2 name vlan2 // define a vlan and name it (if not, the name of vlan2 should be vlan002)

Vlan 3 name vlan3

Vlan 4 name vlan4

Vlan 5 name vlan5

Vlan 6 name vlan6

Vlan 7 name vlan7

Vlan 8 name vlan8

Vlan 9 name vlan9

Exit

 

Interface Port-channel 1 // enter the virtual ethernet channel Group 1

Switchport trunk encapsulation dot1q // encapsulate the trunk for this interface as the 802.1Q frame format

Switchport mode trunk // defines the operation mode of this interface as trunk

Switchport trunk allowed vlan all // this trunk allows all VLANs to pass through

Interface gigabitethernet 0/1 // enter the guitar Ethernet 1 on Module 0

Switchport trunk encapsulation dotlq // encapsulate the trunk for this interface as the 802.1Q frame format

Switchport mode trunk // defines the operation mode of this interface as trunk

Switchport trunk allowed vlan all // this trunk allows all VLANs to pass through

Channel-group 1 mode on // place this interface in Fast Ethernet channel group 1

Interface gigabitethernet 0/2 // same as above

Switchport trunk encapsulation dotlq

Switchport mode trunk

Switchport trunk allowed vlan all

Channel-group 1 mode on

 

Port-channel load-balance src-dst-ip // defines the load balancing mode for the Fast Ethernet channel group (depending on the * source and destination IP addresses)

Interface gigabitethernet 0/3 // enter the guitar Ethernet Port 3 on Module 0

Switchport trunk encapsulation dotlq // encapsulate trunk as 802.1Q

Switchport mode trunk // defines the operation mode of this interface as trunk

 

Switchport trunk allowed vlan all // allow all vlan information to pass through

 

Interface gigabitethernet 0/4 // same as above

Switchport trunk encapsulation dotlq

Switchport mode trunk

Switchport trunk allowed vlan all

 

Interface gigbitethernet 0/5 // same as above

Switchport trunk encapsulation dotlq

Switchport mode trunk

Switchport trunk allowed vlan all

 

Interface gigbitethernet 0/6 // same as above

Switchport trunk encapsulation dotlq

Switchport mode trunk

Switchprot trunk allowed vlan all

 

Interface gigbitethernet 0/7 // enter the gibit Ethernet port 7 on Module 0

Switchport mode access // defines the operation mode of this interface as access mode

Switchport access vlan 9 // defines which vlan this interface can access (actually, this interface is allocated to the vlan)

No shutdown

Spanning-tree vlan 6-9 cost 1000 // in the production tree, the overhead of the vlan6-9 is defined as 10000

 

 

 

Interface range gigabitethernet 0/8-10 // enter the gibit Ethernet ports, 10 on Module 0

Switchport mode access // define the operation mode of these interfaces as access mode

Switchport access vlan 8 // allocate these interfaces to vlan8

No shutdown

Spanning-tree portfast // use portfast on these interfaces (after portfast is used, the operation is not performed when the tree is generated and directly becomes the forwarding status)

 

Interface gigabitethernet 0/11 // enter the gibit Ethernet port 11 on Module 0

Switchport trunk encapsulation dotlq // encapsulate this interface as 802.1Q

Switchport mode trunk // defines the operation mode of this interface as trunk

Switchport trunk allowed vlan all // allow all vlan information to pass through

 

Interface gigabitethernet 0/12 // same as above

Switchport trunk encapsulation dotlq

Switchport mode trunk

Switchport trunk allowed vlan all

 

Interface vlan 1 // The logical interface for entering vlan1 (not a physical interface, used for routing vlan)

Ip address 172.16.1.7 255.255.255.0 // configure the ip address and subnet mask

No shutdown

Standby 1 ip address 172.16.1.9 // redundant Hot Backup (HSRP) is enabled, redundant hot backup group 1, and vro ip address is 172.16.1.9

Standby 1 priority 110 preempt // defines that the priority of this layer-3 Switch in redundant hot backup group 1 is 110, and preempt is used to enable the preemption Mode

 

Interface vlan 2 // same as above

Ip address 172.16.2.252 255.255.255.0

No shutdown

Standby 2 ip 172.16.2.254

Standby 2 priority 110 preempt

Ip access-group 101 in // use the extended access control list in the Inbound direction 101

 

Interface vlan 3 // same as above

Ip address 172.16.3.252 255.255.255.0

No shutdown

Standby 3 ip 172.16.3.254

Standby 3 priority 110 preempt

Ip access-group 101 in

 

Interface vlan 4 // same as above

Ip address 172.16.4.252 255.255.255.0

No shutdown

Standby 4 ip 172.16.4.254

Standby 4 priority 110 preempt

Ip access-group 101 in

 

Interface vlan 5

Ip address 172.16.5.252 255.255.255.0

No shutdown

Standby 5 ip address 172.16.5.254

Standby 5 priority 110 preempt

Ip access-group 101 in

 

Interface vlan 6

Ip address 172.16.6.252 255.255.255.0

No shutdown

Standby 6 ip 172.16.6.254

Standby 6 priority 100 preempt

 

Interface vlan 7

Ip address 172.16.7.252 255.255.255.0

No shutdown

Standby 7 ip 172.16.7.254

Standby 7 priority 100 preempt

 

Interface vlan 8

Ip address 172.16.8.252 255.255.255.0

No shutdown

Standby 8 ip address 172.16.8.254

Standby 8 priority 100 preempt

 

Interface vlan 9

Ip address 172.16.9.252 255.255.255.0

No shutdown

Standby 9 ip 172.16.9.254

Standby 9 priority 100 preempt

 

Access-list 101 deny ip any 172.16.7.0 0.0.0.255 // extended access control list 101

Access-list 101 permit ip any

 

Interface vlan 1 // enter the logical Interface vlan1

Ip helper-address 172.16.8.1 // You can forward a broadcast (helper-address is used to convert a broadcast to unicast and then send it to 172.16.8.1)

Interface vlan 2

Ip helper-address 172.16.8.1

Interface vlan 3

Ip helper-address 172.16.8.1

Interface vlan 4

Ip helper-address 172.16.8.1

Interface vlan 5

Ip helper-address 172.16.8.1

Interface vlan 6

Ip helper-address 172.16.8.1

Interface vlan 7

Ip helper-address 172.16.8.1

Interface vlan 9

Ip helper-address 172.16.8.1

 

Router rip // enable the route protocol RIP

Version 2 // r1_2 is used. If no such sentence exists, r1_1 is used.

Network 172.16.0.0 // network segment for Direct Connection

 

Exit

 

Ip route 0.0.0.0 0.0.0.0 172.16.9.250 // default route. All data packets that cannot be matched in the routing table are routed to the vro 172.16.9.250 at the next hop address.

Line con 0

Line aux 0

Line vty 0 15 // telnet line (there are only five vrouters, which are 0-4)

Password 12345678 // login password

Login

End

Copy running-config startup-config save Configuration

Author's blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.