Results 1 to 11 of 11

Thread: set IP address

  1. #1
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default set IP address

    Hi everyone, iīm doing a DHCP service, but i have a problem, i canīt set the new IP address that the server give to client, i have treat with different classes, but the only thing that i can do is get de Ip address, but i need to set it in the client machine.

    any idea?

    thanks

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    You're implementing RFC 2131? What have you tried so far?

    -Gary-

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,317
    Rep Power
    25

    Default

    i canīt set the new IP address
    Do you get any error messages?
    What classes and methods are you using?

  4. #4
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default

    hi, thanks for your answer

    yes, i already read the RFC 2131, and the application do all the steps (discovery, offer, request, ...), but iīm programing both, server and client, so my client get all the serverīs packets and the server get all the clientīs packets.
    itīs the all application, so i need to assign the ip

  5. #5
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default

    hi Norm

    "Do you get any error messages?
    What classes and methods are you using?"

    i donīt have any error, i have not found a method for set the ip in a computer

  6. #6
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by yolimau View Post
    hi, thanks for your answer

    yes, i already read the RFC 2131, and the application do all the steps (discovery, offer, request, ...), but iīm programing both, server and client, so my client get all the serverīs packets and the server get all the clientīs packets.
    itīs the all application, so i need to assign the ip
    OK, this is going to be specific to the host you're programming for. Is this some kind of embedded system? Please tell us a little more about your project that leads you to be writing a DHCP client in Java.

    -Gary-

  7. #7
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default

    Quote Originally Posted by gcalvin View Post
    OK, this is going to be specific to the host you're programming for. Is this some kind of embedded system? Please tell us a little more about your project that leads you to be writing a DHCP client in Java.

    -Gary-
    Ok, well my application itīs just a project for class, iīm studing, itīs for understand the way that a dhcp service works.

  8. #8
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by yolimau View Post
    Ok, well my application itīs just a project for class, iīm studing, itīs for understand the way that a dhcp service works.
    In that case, we're back to the fact that it's host-specific. You would probably need some C and JNI code, and it's going to be different for Windows, Mac OSX, Linux, etc. For illustration purposes, you could write a script and invoke it with System.exec().

    -Gary-

  9. #9
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default

    Quote Originally Posted by gcalvin View Post
    In that case, we're back to the fact that it's host-specific. You would probably need some C and JNI code, and it's going to be different for Windows, Mac OSX, Linux, etc. For illustration purposes, you could write a script and invoke it with System.exec().

    -Gary-
    so, you`re telling me that i have to set the ip by cmd commands?, opening a cmd in my application and set the ip things or something like that

  10. #10
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    Quote Originally Posted by yolimau View Post
    so, you`re telling me that i have to set the ip by cmd commands?, opening a cmd in my application and set the ip things or something like that
    Basically, yes. Either that, or write C code and Java Native Interface for each host type you would want to run this on. Java is not really a systems-level language -- it's application-level. Java tries to be platform-neutral, which means it can't get very involved in things that are platform-specific. It's also a privileged operation -- you'd need to be an Administrator to change your machine's IP address under most operating systems.

    -Gary-

  11. #11
    yolimau is offline Member
    Join Date
    May 2010
    Posts
    8
    Rep Power
    0

    Default

    Quote Originally Posted by gcalvin View Post
    Basically, yes. Either that, or write C code and Java Native Interface for each host type you would want to run this on. Java is not really a systems-level language -- it's application-level. Java tries to be platform-neutral, which means it can't get very involved in things that are platform-specific. It's also a privileged operation -- you'd need to be an Administrator to change your machine's IP address under most operating systems.

    -Gary-
    ok, thank you so much, iīm going to try that, i hope to have you news soon

Similar Threads

  1. ip address of all clients
    By guneet singh in forum Networking
    Replies: 4
    Last Post: 03-01-2009, 02:01 PM
  2. Looking Up the Address of a Host
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:11 PM
  3. How to get IP Address of the client
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-05-2008, 10:14 AM
  4. JSP – getting IP address
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-29-2008, 09:05 AM
  5. Getting host name/address
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-19-2007, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •