Write a function to automatically import the .csv file and :
1.2.1. Programmatically configure default routes on the vEOS
switches and IP addresses on all their connected interfaces
accordingly. Save configurations to disk.
Commands (after “enable”, watch my recording on how to use
Python to get there):
• configure terminal
• ip routing
• ip route 0.0.0.0/0 default_route_ip [according to the .csv
file]
• interface interface_name
• no switchport
• ip address ip_address/24 [according to the .csv file]
• no shutdown
• end
• copy run start
1.2.2. Programmatically configure an IP address on the ens1
interface of the Ubuntu Server.
Command (after “enable”, watch my recording on how to use Python
to get there):
• ip addr add ip_address/24 dev ens1 [according to the .csv
file] – Do “ip add” in the CLI to ensure that the interface name is
“ens1.” Yours may be different, e.g., ens4
• ip route add default via default_gateway_ip dev ens1.
1.3. Write a function to test the connectivity from the vEOS
devices to other devices::
1.3.1. The function with receive two arguments:
1) the specific vEOS device to ping from, and 2) the IP address
that will be pinged
1.3.2. The function will return the ping result 8
1.3.3. Test the connectivity between vEOS-1 and the Ubuntu
Server’s ens1 interface’s IP address.
The calling instruction will print the result.
Example: print(test_func(vEOS-1, ’10.10.5.1’)) where ‘test_func’
is the function’s name, and 10.10.5.1 is the IP address
Write a function to automatically import the .csv file and : 1.2.1. Programmatically configure default routes on the vEO
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a function to automatically import the .csv file and : 1.2.1. Programmatically configure default routes on the vEO
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!