怎么更改機型配置python?
搭建,橋接,初始化配置。
給每臺路由器做好初始化配置,即配置修改設備默認名稱、配置管理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配置就沒關了,便于后續排錯就對啦!