In all my previous writings, I have talked about automating stuff where SSH is used to access the device. And, SSH is accessible because I have already done the initial configuration in those devices. Let me to describe what I actually mean by saying initial configuration. When Router or Switch is powered on for the first time, then it is blank with no configuration, and it is required to do some initial configuration like assigining management IP Address, creating local user, or enabling SSH, and it is done using Console Port of the device.
It doesn’t make sense to automate the initial configuration of a single router or switch, but if there is a situation when there are a lot of routers and switches then it makes sense. Secondly, If a human is configuring the device then there are chances to make mistakes during configuration or maybe miss out some really important line in the configuration. That’s the reason that we can automate the initial configuration of network devices using Python. There is a library called pySerial which provides the access of serial port, and It can be used for the purpose of automation. There are many situations where it can be very useful like if I have 50 routers and a list of Management IPs to configure in all those routers, then it can be done efficiently. This time, I don’t have any screenshot to attach at the end like the way I usually do, but that’s absolutely fine.