Posts

Showing posts with the label Networking

Multiple Cisco device configuration Backup using python Script

Image
 Multiple Cisco device configuration Backup using python Script Device configuration will be saved as per Hostname.    Saved files are looking as below:  ===================  Python Script: ===================  from netmiko import ConnectHandler import pandas as pd import datetime import os # Read device information from the Excel file device_file = "devices.xlsx" devices_df = pd.read_excel(device_file) # Convert the dataframe to a list of dictionaries devices = devices_df.to_dict( orient = 'records' ) # Directory to save the configuration files output_directory = "device_configs" os.makedirs(output_directory, exist_ok = True ) # Define the commands to be executed commands = [ 'show running-config' , 'show ip interface brief' , 'show version' ] # Get the current date current_date = datetime.datetime.now().strftime( "%Y-%m-%d" ) # Function to connect to a device and save the output to a file def connect_and_save (...

Multiple Cisco device Backup Python Script using Telnet with different port

Image
 Multiple device Backup Python Script using Telnet with different port File will be saved using Device IP address   Need to create a xl file the same file location as named device Create an Excel file (e.g., devices.xlsx )  from netmiko import ConnectHandler import pandas as pd import datetime import os # Read device information from the Excel file device_file = "devices.xlsx" devices_df = pd.read_excel(device_file) # Convert the dataframe to a list of dictionaries devices = devices_df.to_dict( orient = 'records' ) # Directory to save the configuration files output_directory = "device_configs" os.makedirs(output_directory, exist_ok = True ) # Define the commands to be executed commands = [ 'show running-config' , 'show version' ] # Get the current date current_date = datetime.datetime.now().strftime( "%Y-%m-%d" ) # Function to connect to a device and save the output to a file def connect_and_save ( device ): try : ...

Telnet with different port a cisco device login and show command using python script

 Telnet with different port a Cisco device login and show command using python script from netmiko import ConnectHandler # Device information device = { 'device_type' : 'cisco_ios_telnet' , # Specify Telnet connection 'host' : '192.168.1.1' , # IP address of the Cisco device 'port' : '32914' , 'username' : 'cisco' , # Telnet username 'password' : 'cisco' , # Telnet password 'secret' : 'cisco' , # Enable password (if needed) } try : # Establish Telnet connection net_connect = ConnectHandler(**device) # Enter enable mode net_connect.enable() # Define the commands to be executed      commands = [      'show run' ,      'show ip interface brief' ,      'show version' ,      ] # Execute each command and capture the output for command in commands: output = net_connect.send_command(command) ...

Profile Based IKEv1 GRE Tunnel Configuration in Huawei Router

 Huawei Device: ipsec proposal IPSEC-PROPOSAL  esp authentication-algorithm sha1  esp encryption-algorithm aes-256    ike peer IPSEC-PROPOSAL-Sec  version 1  pre-shared-key cipher  ?  ike-proposal 1  remote-address REMOTE-SIDE-IP-ADDRESS(y.y.y.y)  rsa encryption-padding oaep  rsa signature-padding pss  undo local-id-preference certificate enable  ikev2 authentication sign-hash sha2-256    ipsec profile IPSec-Pro-IPSEC-PROPOSAL-Sec  ike-peer IPSEC-PROPOSAL-Sec  proposal IPSEC-PROPOSAL interface Tunnel0/0/x  description TUNNEL-NAME  ip address aa.bb.cc.dd 255.255.255.252  tunnel-protocol gre  source SOURCE-SIDE-IP-ADDRESS(x.x.x.x)  destination REMOTE-SIDE-IP-ADDRESS(y.y.y.y)  ipsec profile IPSec-Pro-IPSEC-PROPOSAL

MPLS L2 VPN Types

Image
  এই বিভাগটি বর্ণনা করে কিভাবে বিভিন্ন মোডে একটি দূরবর্তী MPLS L2VPN    CCC MPLS L2VPN CCC মোড বিপরীত দিকে দুটি স্ট্যাটিক এলএসপি স্থাপন করে এবং স্ট্যাটিক এলএসপিগুলিকে AC-তে আবদ্ধ করে  একটি CCC সংযোগ স্থাপন করে। CCC মোডে প্রতিষ্ঠিত একটি VC কে CCC সংযোগ বলা হয়।   চিত্র 52: CCC MPLS L2VPN নেটওয়ার্ক ডায়াগ্রাম       আপনি চিত্র 52-এ দেখানো কনফিগারেশনগুলি সম্পূর্ণ করার পরে, PE 1 থেকে PE 2 পর্যন্ত একটি স্ট্যাটিক LSP এবং PE 2 থেকে PE 1 পর্যন্ত একটি স্ট্যাটিক LSP প্রতিষ্ঠিত হয়। দুটি LSP-কে PE 1-এ ইন্টারফেস A এবং PE 2-এ ইন্টারফেস B-তে আবদ্ধ করুন। একটি CCC সংযোগ সফলভাবে প্রতিষ্ঠিত হয়েছে। নিম্নলিখিত বর্ণনা করে কিভাবে একটি প্যাকেট CE 1 থেকে CE 2 পর্যন্ত ফরোয়ার্ড করা হয়: PE 1 ইন্টারফেস A-তে CE 1 থেকে একটি প্যাকেট পাওয়ার পরে, এটি প্যাকেটে লেবেল 300 (PE 1 থেকে PE 2 পর্যন্ত স্ট্যাটিক LSP-এর সাথে সম্পর্কিত) যোগ করে। P ডিভাইসটি প্যাকেটটি গ্রহণ করার পরে, এটি লেবেল ফরওয়ার্ডিং টেবিলটি দেখে এবং লেবেল 310 এর সাথে লেবেল 300 অদলবদল করে। প্যাকেটটি পা...