Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Python implementation restart the router     - To see the Linux device tree (Linux)

- Debian 8 (amd64) installation deployment Memcached management tools MemAdmin (Server)

- Zabbix system email alert Python script (Server)

- Oracle10g 64-bit installation solution in Windows 2008 Server R2 (Database)

- Oracle () trunc function usage (Database)

- Linux Telnet access Windows 7 configuration procedure (Linux)

- UUID in Java (Programming)

- Ubuntu 14.04 installation configuration GNOME Classic interface (Linux)

- PL / SQL in forall simple test (Database)

- Oracle multi-user concurrency and transaction processing (Database)

- Linux System Getting Started Learning: The Linux ac command (Linux)

- How to manage and use Logical Volume Management LVM in Ubuntu (Linux)

- Ubuntu 12.04 install RTL8723BE wireless network card driver (Programming)

- Linux Getting Started tutorial: Experience KVM Virtual Machine chapter (Linux)

- Network security system (Network)

- Let OS X support NTFS write file (Linux)

- Ceph tuning --Journal and tcmalloc (Server)

- Getting Started with Linux system to learn: how to install USB webcams come in raspberry (Linux)

- PXE installation of Linux servers (Server)

- LVM management reduces swap partition space to the root partition (Linux)

  Python implementation restart the router
  Add Date : 2018-11-21      
  There are some services that require dynamic IP, so we use the restart router methods. Manual restart is not available, you can use regular script execution. Paste the code of each router, suggesting different. Router telnet functionality required job.

#! / Usr / bin / env python
# - * - Coding: utf-8 - * -
import telnetlib
HOST = ""
USER = "admin"
PASS = "admin"
router = telnetlib.Telnet (HOST)
router.set_debuglevel (2)
router.read_until ( "Username:", 12)
router.write (USER + "\ r \ n")
router.read_until ( "Password:", 12)
router.write (PASS + "\ r \ n")
router.read_until ( "TP-LINK>", 12)
router.write ( "enable \ r \ n")
router.read_until ( "Enter password:", 12)
router.write (PASS + "\ r \ n")
router.read_until ( "TP-LINK #", 12)
router.write ( "sys reboot \ r \ n")
router.read_until ( "Continue?", 12)
router.write ( "Y \ r \ n")
router.close ()
print "Done"
- Eight sorting algorithm implemented in Python (Programming)
- Oracle conditional select statements and looping statements (Database)
- Remote installation of Net-SNMP whole process (Linux)
- OpenDaylight Helium version installed (Linux)
- Detailed use Zabbix monitoring Nginx (Server)
- Improve WordPress performance (Server)
- Ubuntu 14.04 LTS installed Hadoop 1.2.1 (distributed cluster mode) (Server)
- count (*) function in MySQL optimization of InnoDB storage engine (Database)
- Learn to read the source code of vmstat (Linux)
- How to install and configure the KVM and Open vSwitch on Linux distributions (Linux)
- How to Install Foreman under Ubuntu (Server)
- Linux to achieve a simple cp command (Linux)
- The Objects in JavaScript (Programming)
- To install Xen in Ubuntu 12.04 (Linux)
- MySQL appears data too long for column 'name' at row 1 to solve (Database)
- Android developers learning Adapter (data adapter) (Programming)
- Two kinds of agents of Spring AOP (Programming)
- CentOS 7.0 running Docker kernel error solution (Server)
- LVM mirrored logical volume to achieve (Linux)
- Objective-C basic program structure (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.