This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Attach to a ethernet interface usingip 0.0.0.0 using datagram socket

 
Tarun Jain
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Thanks
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you're trying to spoof the source IP? Please tell us what you're trying to achieve by doing that.
 
Tarun Jain
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic