Hướng dẫn cấu hình Nexus Switch

Nội dung tổng quan:

  • Phần 1. Tìm hiểu tổng quan về Nexus Switch
  • Phần 2. Cấu hình cơ bản trên Nexus Switch
  • Phần 3. Kiểm tra bảng chuyển mạch
  • Phần 4. Cấu hình VLAN
  • Phần 5. Cấu hình Trunk
  • Phần 6. Cấu hình Private VLAN
  • Phần 7. Cấu hình STP
  • Phần 8. Cấu hình Storm Control
  • Phần 9. Cấu hình CDP & LLDP
  • Phần 10. Cấu hình UDLD
  • Phần 11. Cấu hình VTP
  • Phần 12. Cấu hình EtherChannel

Các bước thực hiện:

Phần 1. Tìm hiểu tổng quan về Nexus Switch.

Nexus Switch sử dụng Cisco NX-OS software. Cisco should keep maintaining the similarities between their NX-OS, IOS and IOS-XR/XE platforms so the engineer’s work will be easy when it comes to troubleshooting.

Cisco Nexus 3048

Datacenter Virtualization

Cisco Nexus is a very optimal solution for data centers that are still running on legacy architecture or the new cutting edge technologies like datacenter virtualization.

Một số công nghệ Data Center:

  • vPC (Virtual PortChannel)
  • FCoE
  • OVT

Thông tin kỹ thuật của Nexus Switch 3048: https://www.cisco.com/c/en/us/products/collateral/switches/nexus-3000-series-switches/data_sheet_c78-685363.html

Phần 2. Cấu hình cơ bản trên Nexus Switch.

Do you want to enforce secure password standard (yes/no): n

    Enter the password for "admin": Mobile24h.Class
  Confirm the password for "admin": Mobile24h.Class
         ---- Basic System Configuration Dialog ----

This setup utility will guide you through the basic configuration of
the system. Setup configures only enough connectivity for management
of the system.

Please register Cisco Nexus 3000 Family devices promptly with your
supplier. Failure to register may affect response times for initial
service calls. Nexus devices must be registered to receive entitled 
support services.

Press Enter at anytime to skip a dialog. Use ctrl-c at anytime
to skip the remaining dialogs.

Would you like to enter the basic configuration dialog (yes/no): n

  Create another login account (yes/no) [n]:  n

The current setup configuration is as follows:
  policy-map type control-plane copp-system-policy ( default )

Apply and save the config before exiting? (yes/no) [y]: n
User Access Verification
 login: admin
Password: bqkZero.2018
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under
license. Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or the GNU
Lesser General Public License (LGPL) Version 2.1. A copy of each
such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://www.opensource.org/licenses/lgpl-2.1.php
switch#
switch# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
switch(config)#

Đặt tên thiết bị

switch(config)# hostname NX1
NX1(config)#
NX1(config)# end
NX1#

Kiểm tra các cổng

NX1# show interface brief 

--------------------------------------------------------------------------------
Ethernet      VLAN   Type Mode   Status  Reason                   Speed     Port
Interface                                                                   Ch #
--------------------------------------------------------------------------------
Eth1/1        1       eth  access down    Link not connected         auto(D) --
Eth1/2        1       eth  access down    Link not connected         auto(D) --
…
Eth1/48       1       eth  access down    Link not connected         auto(D) --
Eth1/49       1       eth  access down    SFP not inserted            10G(D) --
Eth1/50       1       eth  access down    SFP not inserted            10G(D) --
Eth1/51       1       eth  access down    SFP not inserted            10G(D) --
Eth1/52       1       eth  access down    SFP not inserted            10G(D) --

--------------------------------------------------------------------------------
Port   VRF          Status IP Address                              Speed    MTU
--------------------------------------------------------------------------------
mgmt0  --           down   --                                      --       1500
NX1#

Kiểm tra phiên bản HĐH

NX1# show version 
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_serie
s_home.html
Copyright (c) 2002-2014, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.

Software
  BIOS:      version 1.2.0
  loader:    version N/A
  kickstart: version 6.0(2)U2(2)
  system:    version 6.0(2)U2(2)
  Power Sequencer Firmware: 
             Module 1: version v4.4
  BIOS compile time:       08/25/2011
  kickstart image file is: bootflash:///n3000-uk9-kickstart.6.0.2.U2.2.bin
  kickstart compile time:  2/12/2014 8:00:00 [02/12/2014 17:34:16]
  system image file is:    bootflash:///n3000-uk9.6.0.2.U2.2.bin
  system compile time:     2/12/2014 8:00:00 [02/12/2014 19:23:45]

Hardware
  cisco Nexus 3048 Chassis ("48x1GE + 4x10G Supervisor")
  Intel(R) Celeron(R) CPU        P450 with 3785072 kB of memory.
  Processor Board ID FOC18475N5U

  Device name: NX1
  bootflash:    2007040 kB

Kernel uptime is 0 day(s), 0 hour(s), 39 minute(s), 32 second(s)

Last reset 
  Reason: Unknown
  System version: 6.0(2)U2(2)
  Service: 

plugin
  Core Plugin, Ethernet Plugin
NX1#

Lưu cấu hình

NX1# copy running-config startup-config

Xóa cấu hình

NX1# write erase

Cấu hình cơ bản

NX1(config)#
interface e1/3
  no switchport
  ip address 192.168.1.1 255.255.255.0
  no shutdown
  exit

vlan 8
  name Internet
  exit

feature interface-vlan

interface vlan 8
  ip address 192.168.8.3 255.255.255.0
  no shutdown
  exit

ip route 0.0.0.0 0.0.0.0 192.168.8.1

Cấu hình cơ bản trên NX2.

NX2(config)#
vlan 8
  name Internet
  exit
interface e1/48
  switchport mode access
  switchport access vlan 8
  exit

feature interface-vlan

interface vlan 8
  ip address 192.168.8.2 255.255.255.0
  no shutdown
  exit

ip route 0.0.0.0 0.0.0.0 192.168.8.1

vlan 10
  name LAN10
  exit
interface vlan 10
  ip address 172.16.10.1 255.255.255.0
  no shutdown
  exit

feature dhcp
ip dhcp pool LAN10
  network 172.16.10.0 255.255.255.0
  default-router 172.16.10.1
  dns-server 8.8.8.8
  exit

Cấu hình cơ bản trên R1.

R1(config)#
hostname R1
interface f0/0
  ip address 192.168.8.1 255.255.255.0
  ip nat inside
  no shutdown
  exit
interface f0/1
  ip address dhcp
  ip nat outside
  no shutdown
  exit
ip route 0.0.0.0 0.0.0.0 dhcp
ip route 192.168.1.0 255.255.255.0 192.168.8.3
ip route 172.16.10.0 255.255.255.0 192.168.8.2
ip route 172.16.20.0 255.255.255.0 192.168.8.2

ip nat inside source list 1 interface f0/1 overload
access-list 1 permit 192.0.0.0 0.255.255.255
access-list 1 permit 172.0.0.0 0.255.255.255

Phần 3. Kiểm tra bảng chuyển mạch.

NX1# show mac address-table

Phần 4. Cấu hình VLAN.

NX1# show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Eth1/1, Eth1/2, Eth1/3, Eth1/4
                                                Eth1/5, Eth1/6, Eth1/7, Eth1/8
                                                Eth1/9, Eth1/10, Eth1/11
                                                Eth1/12, Eth1/13, Eth1/14
                                                Eth1/15, Eth1/16, Eth1/17
                                                Eth1/18, Eth1/19, Eth1/20
                                                Eth1/21, Eth1/22, Eth1/23
                                                Eth1/24, Eth1/25, Eth1/26
                                                Eth1/27, Eth1/28, Eth1/29
                                                Eth1/30, Eth1/31, Eth1/32
                                                Eth1/33, Eth1/34, Eth1/35
                                                Eth1/36, Eth1/37, Eth1/38
                                                Eth1/39, Eth1/40, Eth1/41
                                                Eth1/42, Eth1/43, Eth1/44
                                                Eth1/45, Eth1/46, Eth1/47
                                                Eth1/48, Eth1/49, Eth1/50
                                                Eth1/51, Eth1/52

NX1#

Tạo vlan và đặt tên

NX1(config)# vlan 10
NX1(config-vlan)# name DC10
NX1# show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Eth1/1, Eth1/2, Eth1/3, Eth1/4
                                                Eth1/5, Eth1/6, Eth1/7, Eth1/8
                                                Eth1/9, Eth1/10, Eth1/11
                                                Eth1/12, Eth1/13, Eth1/14
                                                Eth1/15, Eth1/16, Eth1/17
                                                Eth1/18, Eth1/19, Eth1/20
                                                Eth1/21, Eth1/22, Eth1/23
                                                Eth1/24, Eth1/25, Eth1/26
                                                Eth1/27, Eth1/28, Eth1/29
                                                Eth1/30, Eth1/31, Eth1/32
                                                Eth1/33, Eth1/34, Eth1/35
                                                Eth1/36, Eth1/37, Eth1/38
                                                Eth1/39, Eth1/40, Eth1/41
                                                Eth1/42, Eth1/43, Eth1/44
                                                Eth1/45, Eth1/46, Eth1/47
                                                Eth1/48, Eth1/49, Eth1/50
                                                Eth1/51, Eth1/52
10   DC10                             active    

NX1#

Gán cổng vào vlan

NX1(config)# interface e1/1, e1/2
NX1(config-if-range)# switchport mode access 
NX1(config-if-range)# switchport access vlan 10
NX1# show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Eth1/3, Eth1/4, Eth1/5, Eth1/6
                                                Eth1/7, Eth1/8, Eth1/9, Eth1/10
                                                Eth1/11, Eth1/12, Eth1/13
                                                Eth1/14, Eth1/15, Eth1/16
                                                Eth1/17, Eth1/18, Eth1/19
                                                Eth1/20, Eth1/21, Eth1/22
                                                Eth1/23, Eth1/24, Eth1/25
                                                Eth1/26, Eth1/27, Eth1/28
                                                Eth1/29, Eth1/30, Eth1/31
                                                Eth1/32, Eth1/33, Eth1/34
                                                Eth1/35, Eth1/36, Eth1/37
                                                Eth1/38, Eth1/39, Eth1/40
                                                Eth1/41, Eth1/42, Eth1/43
                                                Eth1/44, Eth1/45, Eth1/46
                                                Eth1/47, Eth1/48, Eth1/49
                                                Eth1/50, Eth1/51, Eth1/52
10   DC10                             active    Eth1/1, Eth1/2

NX1#

Phần 5. Cấu hình Trunk.

hostname NX1
vlan 10
  name DC10
  exit
interface e1/1
  switchport mode access
  switchport access vlan 10
  exit
interface e1/48
  switchport mode trunk
  exit
hostname NX2
vlan 10
  name DC10
  exit
interface e1/2
  switchport mode access
  switchport access vlan 10
  exit
interface e1/48
  switchport mode trunk
  exit
NX2# show interface trunk 

--------------------------------------------------------------------------------
Port          Native  Status        Port
              Vlan                  Channel
--------------------------------------------------------------------------------
Eth1/48       1       trunking      --

--------------------------------------------------------------------------------
Port          Vlans Allowed on Trunk
--------------------------------------------------------------------------------
Eth1/48       1-4094

--------------------------------------------------------------------------------
Port          Vlans Err-disabled on Trunk
--------------------------------------------------------------------------------
Eth1/48       none

--------------------------------------------------------------------------------
Port          STP Forwarding
--------------------------------------------------------------------------------
Eth1/48       1,10

--------------------------------------------------------------------------------
Port          Vlans in spanning tree forwarding state and not pruned
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Port          Vlans Forwarding on FabricPath
--------------------------------------------------------------------------------
Eth1/48       none
NX2#

Cấu hình theo sơ đồ bài LAB.

hostname NX2
interface ethernet 1/1 – 2
  switchport mode trunk
  exit
hostname NX1
interface ethernet 1/1 – 2
  switchport mode trunk
  exit
NX1# show interface trunk

--------------------------------------------------------------------------------
Port          Native  Status        Port
              Vlan                  Channel
--------------------------------------------------------------------------------
Eth1/1        1       trunking      --
Eth1/2        1       trunking      --

--------------------------------------------------------------------------------
Port          Vlans Allowed on Trunk
--------------------------------------------------------------------------------
Eth1/1        1-4094
Eth1/2        1-4094

--------------------------------------------------------------------------------
Port          Vlans Err-disabled on Trunk
--------------------------------------------------------------------------------
Eth1/1        none
Eth1/2        none

--------------------------------------------------------------------------------
Port          STP Forwarding
--------------------------------------------------------------------------------
Eth1/1        1
Eth1/2        none

--------------------------------------------------------------------------------
Port          Vlans in spanning tree forwarding state and not pruned
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Port          Vlans Forwarding on FabricPath
--------------------------------------------------------------------------------
Eth1/1        none
Eth1/2        none
NX1#

Xem tiếp trang 2

Đặng Đình Công

Mình là Đặng Đình Công. Công việc hiện tại của mình là quản trị viên hệ thống mạng máy tính. Hiện tại mình đang học, nghiên cứu và làm việc về mảng hệ thống và bảo mật Microsoft, Cisco, ảo hóa VMware,... Blog được lập ra với phương diện cá nhân nên chắc sẽ không tránh khỏi nhiều sai sót. Mong được sự góp ý của tất cả các bạn.

You may also like...