搭建,橋接,初始化配置。
給每臺路由器做好初始化配置,即配置修改裝置預設名稱、配置管理IP地址、配置SSH及登入使用者名稱和密碼。
以R2為例(小白,其他裝置參考R2配置),修改裝置名、配置IP地址:
[Huawei]SYS R2
[R2]
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.56.20 24
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]qu
以R2為例,配置SSH,其他裝置參考如下即可:
[R2]rsa local-key-pair create
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]:2048
Generating keys...
.......+++
..............+++
.....++++++++
...............++++++++
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]protocol inbound ssh
[R2]aaa
[R2-aaa]local-user along password cipher along123
[R2-aaa]local-user along privilege level 15
[R2-aaa]local-user along service-type ssh
[R2-aaa]ssh user along authentication-type password
[R2]stelnet server enable
上述配置完,建議用secureCRT先登入一下各個裝置,驗證網路連通性、ssh連通性是否ok?
這裡以R1為例,驗證一下。測試時,你們可以每臺都驗證一下。
這樣驗證的好處,假如待會我們寫的python指令碼如果有問題,那跟網路、ssh配置就沒關了,便於後續排錯就對啦!
搭建,橋接,初始化配置。
給每臺路由器做好初始化配置,即配置修改裝置預設名稱、配置管理IP地址、配置SSH及登入使用者名稱和密碼。
以R2為例(小白,其他裝置參考R2配置),修改裝置名、配置IP地址:
[Huawei]SYS R2
[R2]
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.56.20 24
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]qu
[R2]
以R2為例,配置SSH,其他裝置參考如下即可:
[R2]rsa local-key-pair create
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[n]:y
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Input the bits in the modulus[default = 512]:2048
Generating keys...
.......+++
..............+++
.....++++++++
...............++++++++
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]protocol inbound ssh
[R2]aaa
[R2-aaa]local-user along password cipher along123
[R2-aaa]local-user along privilege level 15
[R2-aaa]local-user along service-type ssh
[R2-aaa]ssh user along authentication-type password
[R2]
[R2]stelnet server enable
[R2]
上述配置完,建議用secureCRT先登入一下各個裝置,驗證網路連通性、ssh連通性是否ok?
這裡以R1為例,驗證一下。測試時,你們可以每臺都驗證一下。
這樣驗證的好處,假如待會我們寫的python指令碼如果有問題,那跟網路、ssh配置就沒關了,便於後續排錯就對啦!