I need to connect to a network interface eg. eth1 using source ip 0.0.0.0.
I need this ip as i am trying to send a DHCP discover packet from this interface.
But i am not able to connect to this interface when ip is not provided while creating DatagramSocket.
Packet is always send using default interface like eth0(and source ip changes to ip of this interface).
I checked this online but the solution provided is not working correctly and i am not able to figure out why.
Kindly help me regarding this.
So you're trying to spoof the source IP? Please tell us what you're trying to achieve by doing that.
Joined: Jul 09, 2014
I am making a simulator which simulates a vm on a server without actually launching a VM.
I need to give IP to this VM. So i am trying to send DHCP request using my main server on behalf of this VM and store the received IP for furthur processing in my DB.