Jump to ID:
Networking

Project Home

Discussions

Wiki

Project Info
Forum Topic - How to programmatically set the net mask of an IP alias: Page 1 of 2 (2 Items)
   
 
 
How to programmatically set the net mask of an IP alias  
I am adding an IP alias to en0 using ioctl SIOCAIFADDR function in my application.  This works OK.  Next, I try to set 
the subnet mask using ioctl SIOCSIFNETMASK, but this changes the network mask of the primary IP address.  I tried to 
'bind' the alias address to the socket before calling ioctl but this didn't work.  How do I set the subnet mask (and 
broadcast address) for an IP alias?