Sample Header Ad - 728x90

How to determine next available network interface name and ip range?

0 votes
3 answers
157 views
I am working on an application which can create TUN/TAP interface on host machine. I can create such interfaces using: sudo ip tuntap add tap0 mode tap Now the thing is, tap0 is hardcoded here. It should be dynamic. When I create next tap device, it should be tap1 and so on. Now when I go ahead to give range to the device, I can manually do like this: sudo ip addr add 172.16.0.1/24 dev tap0 Now when I create tap1, I don't want to overlap the ip. Is there any easy way to manage these tap devices?
Asked by Santosh Kumar (4203 rep)
Jul 25, 2022, 09:28 AM
Last activity: Jul 25, 2022, 08:15 PM