علی شکیبا

دفتر یادداشت دیجیتال برای هر چیز مفید!

۲ مطلب با کلمه‌ی کلیدی «cisco» ثبت شده است

import telnetlib
for i in range(1,256):
host = 'xyz.xyz.xyz.' + str(i)
user = 'user'.encode('ascii')
password = 'pass'.encode('ascii')
try:
tn = telnetlib.Telnet(host, port=23)
tn.read_until(b'Username: ')
tn.write(user + b'\n')
tn.read_until(b'Password: ')
tn.write(password + b'\n')
tn.write(b'conf t' + b'\n')
tn.write(b'access-list zz permit xyz.xyz.xyz.xyz' + b'\n')
tn.write(b'exit' + b'\n')
tn.write(b'write memory' +b'\n')
tn.write(b'exit' + b'\n')
tn.read_all()
print('Done for ' + host)
except:
print('Not exists ' + host)
۰ نظر موافقین ۱ مخالفین ۰ ۰۱ ارديبهشت ۹۸ ، ۰۰:۲۶
علی شکیبا

در سوویچ های لایه ۳

show ip arp *ipaddress*

show mac address-table address *mac-address*
show mac-address-table address *mac-address*

بلاک دوم، یکی از دستورها کار می کند (نحو متفاوت)

در سوییچ های لایه ۲ نیز مثل فوق است، با این تفاوت که دستور اول در روتر اجرا می شود.

۰ نظر موافقین ۱ مخالفین ۰ ۲۵ فروردين ۹۸ ، ۱۷:۱۷
علی شکیبا