顯示具有 CISCO 標籤的文章。 顯示所有文章
顯示具有 CISCO 標籤的文章。 顯示所有文章

2019年11月19日 星期二

VMWare ESXi 6.5 VLAN 串接 CISCO Port-channel 設定

CISCO Switch 設定
設定 Port-channel 時最好不要接網路線或者把一個 Port shutdown,以免造成 loop
#config terminal
(config)#interface gi1/0/1
(config-if)#channel-group 1 mode on
(config-if)#switchport mode trunk

(config-if)#interface gi1/0/2
(config-if)#channel-group 1 mode on
(config-if)#switchport mode trunk

(config-if)#interface po1
(config-if)#switchport mode trunk

檢查 Switch witch 設定,確認 interface gi1/0/1、interface gi1/0/2 和 Port-channel1 是否為 up
#show ip interface brief

#show etherchannel summary
Group  Port-channel  Protocol    Ports
------+-------------+-----------+-----------------------------------------------
1      Po1(SU)          -        Gi1/0/1(P)  Gi1/0/2(P)

#show interface po1
Port-channel1 is up, line protocol is up (connected) 
  Hardware is EtherChannel, address is 2222.3333.4444 (bia 2222.3333.4444)
  Description: VM_LAB
  MTU 1500 bytes, BW 2000000 Kbit/sec, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 1000Mb/s, link type is auto, media type is unknown
  input flow-control is off, output flow-control is unsupported
  Members in this channel: Gi1/0/1 Gi1/0/2


VMware ESXi vSwitch 設定
新增 vSwitch 設定,按【新增上行】可加入多張網路介面到 vSwitch

負載平衡 欄位需選擇【根據 IP 雜湊進行路由】


VMware ESXi  VLAN ID 設定
新增 VLAN 連接群組

要新增多個連接埠,重複上圖步驟即可加入多個VLAN到Trunk_vSwitch裡。

設定好的 VLAN 欄位值



如果沒有其他設備的問題,依上面步驟就可設定好 VMWare ESXi VLAN 串接 CISCO Port-channel

我自己是遇到 CISCO Switch 的 VTP mode 被設定為 Server,找了好久才找到問題!!!!!!!!!




2017年3月22日 星期三

CISCO kron 排程自動備份+TFTP Server

CISCO 設備新增備份排程:

mis_c2960#configure config
mis_c2960(config)#kron policy-list Backup_config      #設定排程任務名稱
mis_c2960(config-kron-policy)#cli write      #以免備份不完全,先將 running-config 的設定寫入一次
mis_c2960(config-kron-policy)#cli show run | redirect tftp://192.168.1.1/c2960.cfg     #設定要執行的指令及TFTP Server 位址、檔名
mis_c2960(config-kron-policy)#exit

設定排程執行時間:
mis_c2960(config)#kron occurrence Backup_config at 23:00 Sun recurring      #每個星期日執行
mis_c2960(config-kron-occurrence)#policy-list Backup_config      #啟動排程
mis_c2960(config-kron-occurrence)#end

寫入剛才設定:
mis_c2960#write

查詢排程工作:
mis_c2960(config-kron-occurrence)#show kron schedule

如果要移除備份排程:
mis_c2960#configure config
mis_c2960(config)#no kron policy-list Backup_config
mis_c2960(config)#no kron occurrence Backup_config at 23:00 Sun recurring




TFTP Server:


Windows TFTP 軟體:


Windows 排程工作,在 CISCO 備份前搬移之前的 config 檔案,並刪除過期的 config 檔案:
moveConfig.bat
內容:
SET src_folder=C:\TFTP_Data
SET dst_folder=C:\TFTP_Data\backup
SET time=%date:~0,4%%date:~5,2%%date:~8,2%
SET delday=30

for /f %%a IN ('dir "%src_folder%\*.cfg" /b') do move %src_folder%\%%a %dst_folder%\%time%-%%a

forfiles -p %dst_folder% -s -m *.cfg /D -%delday% /C "cmd /c del @PATH" > nul 2>&1






Linux TFTP server 套件:

yum install -y tftp tftp-server xinetd


修改 /etc/xinetd/tftp 設定及TFTP 資料目錄:
service tftp
{
        socket_type             = dgram
        protocol                  = udp
        wait                         = yes
        user                         = root
        server                      = /usr/sbin/in.tftpd
        server_args             = -s /tftpboot -c #-c 允許上傳檔案
        disable                    = no  #enable Service
        per_source              = 11
        cps                          = 100 2
        flags                       = IPv4
}

建立 TFTP 檔案目錄:
mkdir -p /tftpboot/backup
chmod o+w /tftpboot

systemctl enable xinetd
systemctl start xinetd

因為CISCO的 kron 建立備份時,無法自動命名,所以在 Linux 上建立一個搬移備份檔的script:
vi moveConfig.sh
內容:
#!/bin/bash

Date=$(date +"%Y%m%d")
#config檔備份目錄
FileDir=/tftpboot
#舊config檔搬移目錄
BackupDir=/tftpboot/backup
#過期的檔案
DelFile=30

for file in `ls $FileDir`;
do
    if [ -f ${FileDir}/${file} ]; then
       mv ${FileDir}/${file} ${BackupDir}/${Date}-${file} && echo "${Date} Backup success." >> ${BackupDir}/backup.log
    fi
done

#刪除超過設定天數的檔案
find $BackupDir -type f -daystart -mtime +$DelFile -exec rm -rf {} \; > /dev/null 2>&1

設定 moveConfig.sh 檔案執行權限:
chmod +x moveConfig.sh

在 CISCO 設備備份 config 前,執行搬移舊 config 檔案排程:
50 22 * * * /bin/sh /root/moveConfig.sh > /dev/null 2>&1




CubeCOS 虛擬機刪除網路介面,且主機內沒有 virtio 驅動程式成為孤島主機時,進行 virtio iso 掛載流程

 # 當 CubeCOS 虛擬機刪除網路介面,且主機內沒有 virtio 驅動程式成為孤島主機時,進行 virtio iso 掛載流程。 # 步驟一:確認目標虛擬機的底層名稱 # 在 Compute Node(計算節點)上列出運行中的 instance,並反查對應的 OpenSt...