For this purpose, I was doing some research on how to alias and bring up multiple Ethernet interfaces in a Linux system. I couldn’t easily find any help on how to bring up aliased interfaces using C [I found many references about aliasing using Ifconfig command]. So, I wrote a generic application which can bring up multiple aliased interfaces. Here is the code. I believe I have made it as simple as I can and you can modify and try experiments on your own. To start with, you can try changing different members in the ifreq structure.
When I showed this to a colleague of mine - who happens to be a scripting guru - he wrote a small script which can be used to bring up multiple interfaces. This may also be useful I guess. Anyway, you are free to take this and do experiments on your own.
For more info about the structures used in the program, here are the links.struct sockaddr_in
struct ifreq
Please share your comments and thoughts so that I can improve the ways I do coding. Special thanks to Bala who wrote the script and Adil, who provided me with the code to start off with.
ps: I am really sorry that I have put the code as an image, I don't know why, but I was not able to put the code as it is, it was giving me some problems.








