Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Changing IP address without rebooting?

  1. #1
    Join Date
    Feb 2007
    Beans
    863

    Changing IP address without rebooting?

    Hi,


    Let suppose that you are in DHCP in an intranet network (rj45, ifconfig on eth0). In addition, the router gives you an IP number, and let suppose that it is allowed to change it as you wish. You have 192.168.1.100, and you desire to change it to 192.168.1.105. You simply wish to make it non permanent, so you do not desire to modify the /etc/. Why? Because you are in an hotel with an intranet. Your travel is great, and tomorrow morning, you leave early.

    So the command would be to use ifconfig and dhclient. There are actually many possibilities, and you might wish not to modprob again your eth0 or do /etc/init.d/networking restart. You also would like to avoid rebooting (sudo reboot), because your screen session is heavily compiling a program.

    you desire the 192.168.1.105, the command might be on the good direction but it is not sufficient.
    Code:
    sudo ifconfig eth0 192.168.1.105
    What is the best way to make your IP change, this without rebooting?

    thank you
    Last edited by honeybear; December 16th, 2012 at 05:26 AM.

  2. #2
    Join Date
    Nov 2005
    Location
    Lincolnshire, UK
    Beans
    1,461
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Changing IP address without rebooting?

    honeybear: I have to ask the question why do you care what IP address the DHCP server allocates your client? One address is very much like another!

    While you can allocate fixed IP addresses within your own LAN, you have no control over, for example, a hotel LAN and therefore the DHCP server will define the IP address you receive. Personally, I can't think of any way a client PC can define a DHCP IP address but I remain open to suggestions.

  3. #3
    Join Date
    Feb 2007
    Beans
    863

    Re: Changing IP address without rebooting?

    Quote Originally Posted by Zill View Post
    honeybear: I have to ask the question why do you care what IP address the DHCP server allocates your client? One address is very much like another!
    because.


    Any further input about the thread eventual answer?

  4. #4
    Join Date
    Jan 2007
    Beans
    6,540
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Changing IP address without rebooting?

    Quote Originally Posted by honeybear View Post
    because.
    The evasiveness of this answer makes me wonder if you're trying to circumvent something. It was a legitimate question. I think if you want assistance you should clarify that what you're trying to do is above board.

  5. #5
    Join Date
    Feb 2007
    Beans
    863

    Re: Changing IP address without rebooting?

    Quote Originally Posted by Paqman View Post
    The evasiveness of this answer makes me wonder if you're trying to circumvent something. It was a legitimate question. I think if you want assistance you should clarify that what you're trying to do is above board.
    I think that I have been sufficiently clear on the first post.
    Why the person would need to know why actually it is aimed? funny, is that it is a simple answer. I took an example to make it simpler.


    If I dont give any answer, then, no help, right? I thought that people are all free and have right to refuse to tell all of their life. You want also my ip and root passwd?


    Great board.
    Last edited by honeybear; December 16th, 2012 at 02:31 PM.

  6. #6
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,782

    Re: Changing IP address without rebooting?

    Change the IP address in your network manager or /etc/network/interfaces

    then do following

    Code:
    sudo ifdown eth0
    sudo ifup eth0
    or a
    Code:
    sudo service networking restart
    Or substitute eth0 for wlan0 where applicable if its your wireless interface

    As for wanting to change your own IP i see no reason why it should be considered underhand in anyways
    Last edited by haqking; December 16th, 2012 at 02:43 PM.
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  7. #7
    Join Date
    Jan 2007
    Beans
    6,540
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Changing IP address without rebooting?

    Quote Originally Posted by honeybear View Post
    If I dont give any answer, then, no help, right? I thought that people are all free and have right to refuse to tell all of their life. You want also my ip and root passwd?
    You're free to provide as much or as little information as you want, and everybody is free to help you as much or as little as they want.

  8. #8
    Join Date
    Feb 2007
    Beans
    863

    Re: Changing IP address without rebooting?

    Quote Originally Posted by haqking View Post
    Change the IP address in your network manager or /etc/network/interfaces

    then do following

    Code:
    sudo ifdown eth0
    sudo ifup eth0
    or a
    Code:
    sudo service networking restart
    Or substitute eth0 for wlan0 where applicable if its your wireless interface

    As for wanting to change your own IP i see no reason why it should be considered underhand in anyways
    Hi,

    this is what I usually do but visibly I am not so sure that it is the most suited option.

    Code:
    ifdown eth0 
    ifconfig eth0 192.168.1.105 
    ifup eth0 
    dhclient
    there must be sthg better than that

  9. #9
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,782

    Re: Changing IP address without rebooting?

    Quote Originally Posted by honeybear View Post
    Hi,

    this is what I usually do but visibly I am not so sure that it is the most suited option.

    Code:
    ifdown eth0 
    ifconfig eth0 192.168.1.105 
    ifup eth0 
    dhclient
    there must be sthg better than that
    I dont get what you mean in "better" better how ? does it work or not ?
    Feel Free to Bitcoin Tip: 135Rp4pwwYTHEJ4u8bxKaDQiC91N9LUoV2

    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  10. #10
    Join Date
    Feb 2007
    Beans
    863

    Re: Changing IP address without rebooting?

    Quote Originally Posted by haqking View Post
    I dont get what you mean in "better" better how ? does it work or not ?
    Most of the time yes, but I think that it is not suited and not the right way

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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