Answer the question
In order to leave comments, you need to log in
How to programmatically create multiple network interfaces?
There is one physical network interface. I want to create programmatically , say 10 and use them at the same time. Through the Linux API. Not via console.
How to do it, in which direction to dig?
Answer the question
In order to leave comments, you need to log in
As I understand it, you want to do the same thing that can be done through ifconfig, only without ifconfig - directly kicking the system. (Are you sure that you really need this?)
Actually, there is libnetlink for this (which iproute uses), which can do everything that the system can do in general regarding network interfaces.
I recommend taking and looking at ifconfig sources, and using the debugger to see how it does what you need. the documentation for libnetlink, in my opinion, is worthless and incomplete (to put it mildly, a lot of what is used in ifconfig is not described at all) and, in my opinion, the API is not very convenient there.
Well, for example https://linuxconfig.org/configuring-virtual-networ... In
general, a search for linux virtual ethernet gives an answer in 5 seconds
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question