Results 1 to 7 of 7

Thread: how do I change static IP?

  1. #1
    Join Date
    Apr 2013
    Beans
    8

    how do I change static IP?

    I did this on my Ubuntu Server box a while ago but forgot how to do it.

    The machine was assigned a static IP 192.168.2.x.
    Then I got a new modem/router and it now uses 192.168.1.y for the network.

    How do I assign a new static IP to my Ubuntu Server?

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,763
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: how do I change static IP?

    Edit /etc/network/interfaces.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,667
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: how do I change static IP?

    Hi user201304. Welcome to the forums

    In the Ubuntu server edition you edit the file /etc/network/interfaces

    Let us know if you need more help with that.

    Come here often and have fun.
    Regards.

  4. #4
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: how do I change static IP?

    That'd be one advantage of using a static lease (on the DHCP server - AKA router) - but you'd still end up editing files...
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad] [Sub-forum]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  5. #5
    Join Date
    Apr 2013
    Beans
    8

    Re: how do I change static IP?

    Ok I'm connected again, thanks!

    Quote Originally Posted by Iowan View Post
    That'd be one advantage of using a static lease (on the DHCP server - AKA router) - but you'd still end up editing files...
    How does the static lease work? I used a static IP because it's easier to work with that locally instead of having to find the new IP every now and then.

    By the way, would you happen to know how to change the port number for Apache? Last time I also changed the port number on the web server, so that in order to access it I have to type http://address:1234 instead of just http://address (and again I've forgotten how to do it)

  6. #6
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: how do I change static IP?

    Quote Originally Posted by user201304 View Post
    How does the static lease work?
    Many (not all) routers with built-in DHCP server let you set up Reserved Addresses - based on a machine's MAC address. The machine is configured to use DHCP, but receives the same address each time.

    The Server Guide has information on changing the port:
    The Listen directive specifies the port, and optionally the IP address, Apache2 should listen on. If the IP address is not specified, Apache2 will listen on all IP addresses assigned to the machine it runs on. The default value for the Listen directive is 80. Change this to 127.0.0.1:80 to cause Apache2 to listen only on your loopback interface so that it will not be available to the Internet, to (for example) 81 to change the port that it listens on, or leave it as is for normal operation. This directive can be found and changed in its own file, /etc/apache2/ports.conf
    Last edited by Iowan; April 8th, 2013 at 01:00 AM.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad] [Sub-forum]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  7. #7
    Join Date
    Apr 2013
    Beans
    8

    Re: how do I change static IP?

    Quote Originally Posted by Iowan View Post
    Many (not all) routers with built-in DHCP server let you set up Reserved Addresses - based on a machine's MAC address. The machine is configured to use DHCP, but receives the same address each time.
    My new router has that feature and it works, thanks for the tip.

    The Server Guide has information on changing the port:
    I changed
    /etc/apache2/ports.conf
    and
    /etc/apache2/sites-enabled/000-default
    to listen to the same ports, restarted the service, and it seems to work.

    Thanks guys!

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
  •