The command of ip route gives out this result: ** YOU MUST WORK WITH THIS OUTPUT** 0.0.0.0/1 via 10.9.0.1 dev tun0 default via 192.168.2.254 dev enp6s0 proto static metric 100 10.8.1.4/24 dev tun0 proto kernel scope link src 10.8.0.2 192.0.0.1/1 via 10.8.0.1 dev tun1 139.84.1.145 via 192.168.2.254 dev enp6s0 172.234.0.0/16 dev virbr0 scope link metric 1000 linkdown 192.168.8.0/24 dev enp6s0 proto kernel scope link src 192.168.4.36 metric 100 192.168.127.0/24 dev virbr0 proto kernel scope link src 192.168.126.3 linkdown 12.12.24.0/24 dev enp10s0 proto kernel scope link src 10.11.40.1 linkdown Task 1 - Work To Do Each item indicates an IP route linked with a specific network interface. In line 1, for instance, the route 0.0.0.0/1 is connected with the interface tun0. Create Python code to show a list of routes associated with each interface. Example Routes per Interface: tun0 : 0.0.0.0/1, 10.9.0.1/24 enp6s0 : 192.168.4.36, 192.168.8.0/24
The command of ip route gives out this result:
** YOU MUST WORK WITH THIS OUTPUT**
0.0.0.0/1 via 10.9.0.1 dev tun0
default via 192.168.2.254 dev enp6s0 proto static metric 100
10.8.1.4/24 dev tun0 proto kernel scope link src 10.8.0.2
192.0.0.1/1 via 10.8.0.1 dev tun1
139.84.1.145 via 192.168.2.254 dev enp6s0
172.234.0.0/16 dev virbr0 scope link metric 1000 linkdown
192.168.8.0/24 dev enp6s0 proto kernel scope link src 192.168.4.36 metric 100
192.168.127.0/24 dev virbr0 proto kernel scope link src 192.168.126.3 linkdown
12.12.24.0/24 dev enp10s0 proto kernel scope link src 10.11.40.1 linkdown
Task 1 - Work To Do
Each item indicates an IP route linked with a specific network interface. In line 1, for instance, the route 0.0.0.0/1 is connected with the interface tun0.
Create Python code to show a list of routes associated with each interface.
Example
Routes per Interface:
tun0 : 0.0.0.0/1, 10.9.0.1/24
enp6s0 : 192.168.4.36, 192.168.8.0/24
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images