permaculture playing cards*
The moose likes Sockets and Internet Protocols and the fly likes Attach to a ethernet interface usingip 0.0.0.0 using datagram socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Attach to a ethernet interface usingip 0.0.0.0 using datagram socket" Watch "Attach to a ethernet interface usingip 0.0.0.0 using datagram socket" New topic
Author

Attach to a ethernet interface usingip 0.0.0.0 using datagram socket

Tarun Jain
Greenhorn

Joined: Jul 09, 2014
Posts: 7
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
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
So you're trying to spoof the source IP? Please tell us what you're trying to achieve by doing that.


Ping & DNS - my free Android networking tools app
Tarun Jain
Greenhorn

Joined: Jul 09, 2014
Posts: 7
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attach to a ethernet interface usingip 0.0.0.0 using datagram socket