How to change your Local IP?












1














While I order a hp server for my Ubuntu server, I am currently temporarily using my laptop as a server instead. I installed Ubuntu 13.10 and other programs like Webmin, etc, etc while being connected to my router through wi-fi. Additionally, through a wi-fi connection, I have hosted numerous websites, game servers and an ftp server.



The issue is that when I try to connect the laptop to the same router through ethernet, the local ip changes. This means that no services, such as Webmin, work locally or publicly. When I go back to using wi-fi, the issue is solved, however, because the wi-fi connection cannot maintain the traffic to and from the server, I need to use ethernet connection to keep up with the demand.



I have portforwarded the ports I use from my wi-fi local ip to my ethernet local ip but I have no luck so far since the problem is on the local side, not from local to public.



My question is, how can I configure my services to the new IP?



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#NetworkManager#auto wlan0
#NetworkManager#iface wlan0 inet dhcp
#NetworkManager# wpa-ssid routername
#NetworkManager# wpa-psk routerpassword


The result of ip ad is:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:1c:23:3a:24:db brd ff:ff:ff:ff:ff:ff
inet 192.168.***.***/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.***.***/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::21c:23ff:fe3a:24db/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:19:d2:03:0c:f8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::219:d2ff:fe03:cf8/64 scope link
valid_lft forever preferred_lft forever

$ ip r
default via 192.168.***.*** dev eth0 proto static
192.168.***.***/24 dev eth0 proto kernel scope link src 192.168.***.*** metric 1

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes









share|improve this question
























  • Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
    – guntbert
    Feb 22 '14 at 17:18










  • Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
    – user251124
    Feb 22 '14 at 17:19


















1














While I order a hp server for my Ubuntu server, I am currently temporarily using my laptop as a server instead. I installed Ubuntu 13.10 and other programs like Webmin, etc, etc while being connected to my router through wi-fi. Additionally, through a wi-fi connection, I have hosted numerous websites, game servers and an ftp server.



The issue is that when I try to connect the laptop to the same router through ethernet, the local ip changes. This means that no services, such as Webmin, work locally or publicly. When I go back to using wi-fi, the issue is solved, however, because the wi-fi connection cannot maintain the traffic to and from the server, I need to use ethernet connection to keep up with the demand.



I have portforwarded the ports I use from my wi-fi local ip to my ethernet local ip but I have no luck so far since the problem is on the local side, not from local to public.



My question is, how can I configure my services to the new IP?



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#NetworkManager#auto wlan0
#NetworkManager#iface wlan0 inet dhcp
#NetworkManager# wpa-ssid routername
#NetworkManager# wpa-psk routerpassword


The result of ip ad is:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:1c:23:3a:24:db brd ff:ff:ff:ff:ff:ff
inet 192.168.***.***/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.***.***/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::21c:23ff:fe3a:24db/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:19:d2:03:0c:f8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::219:d2ff:fe03:cf8/64 scope link
valid_lft forever preferred_lft forever

$ ip r
default via 192.168.***.*** dev eth0 proto static
192.168.***.***/24 dev eth0 proto kernel scope link src 192.168.***.*** metric 1

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes









share|improve this question
























  • Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
    – guntbert
    Feb 22 '14 at 17:18










  • Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
    – user251124
    Feb 22 '14 at 17:19
















1












1








1


2





While I order a hp server for my Ubuntu server, I am currently temporarily using my laptop as a server instead. I installed Ubuntu 13.10 and other programs like Webmin, etc, etc while being connected to my router through wi-fi. Additionally, through a wi-fi connection, I have hosted numerous websites, game servers and an ftp server.



The issue is that when I try to connect the laptop to the same router through ethernet, the local ip changes. This means that no services, such as Webmin, work locally or publicly. When I go back to using wi-fi, the issue is solved, however, because the wi-fi connection cannot maintain the traffic to and from the server, I need to use ethernet connection to keep up with the demand.



I have portforwarded the ports I use from my wi-fi local ip to my ethernet local ip but I have no luck so far since the problem is on the local side, not from local to public.



My question is, how can I configure my services to the new IP?



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#NetworkManager#auto wlan0
#NetworkManager#iface wlan0 inet dhcp
#NetworkManager# wpa-ssid routername
#NetworkManager# wpa-psk routerpassword


The result of ip ad is:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:1c:23:3a:24:db brd ff:ff:ff:ff:ff:ff
inet 192.168.***.***/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.***.***/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::21c:23ff:fe3a:24db/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:19:d2:03:0c:f8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::219:d2ff:fe03:cf8/64 scope link
valid_lft forever preferred_lft forever

$ ip r
default via 192.168.***.*** dev eth0 proto static
192.168.***.***/24 dev eth0 proto kernel scope link src 192.168.***.*** metric 1

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes









share|improve this question















While I order a hp server for my Ubuntu server, I am currently temporarily using my laptop as a server instead. I installed Ubuntu 13.10 and other programs like Webmin, etc, etc while being connected to my router through wi-fi. Additionally, through a wi-fi connection, I have hosted numerous websites, game servers and an ftp server.



The issue is that when I try to connect the laptop to the same router through ethernet, the local ip changes. This means that no services, such as Webmin, work locally or publicly. When I go back to using wi-fi, the issue is solved, however, because the wi-fi connection cannot maintain the traffic to and from the server, I need to use ethernet connection to keep up with the demand.



I have portforwarded the ports I use from my wi-fi local ip to my ethernet local ip but I have no luck so far since the problem is on the local side, not from local to public.



My question is, how can I configure my services to the new IP?



# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#NetworkManager#auto wlan0
#NetworkManager#iface wlan0 inet dhcp
#NetworkManager# wpa-ssid routername
#NetworkManager# wpa-psk routerpassword


The result of ip ad is:



$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:1c:23:3a:24:db brd ff:ff:ff:ff:ff:ff
inet 192.168.***.***/24 brd 192.168.1.255 scope global eth0
valid_lft forever preferred_lft forever
inet 192.168.***.***/24 brd 192.168.1.255 scope global secondary eth0
valid_lft forever preferred_lft forever
inet6 fe80::21c:23ff:fe3a:24db/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:19:d2:03:0c:f8 brd ff:ff:ff:ff:ff:ff
inet6 fe80::219:d2ff:fe03:cf8/64 scope link
valid_lft forever preferred_lft forever

$ ip r
default via 192.168.***.*** dev eth0 proto static
192.168.***.***/24 dev eth0 proto kernel scope link src 192.168.***.*** metric 1

$ sudo ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes






networking server 13.10 ip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 31 at 5:53









muru

1




1










asked Feb 22 '14 at 15:28









user251124

28128




28128












  • Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
    – guntbert
    Feb 22 '14 at 17:18










  • Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
    – user251124
    Feb 22 '14 at 17:19




















  • Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
    – guntbert
    Feb 22 '14 at 17:18










  • Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
    – user251124
    Feb 22 '14 at 17:19


















Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
– guntbert
Feb 22 '14 at 17:18




Why do I see #NetworkManager - that is not default on a server install - or are you using a GUI?
– guntbert
Feb 22 '14 at 17:18












Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
– user251124
Feb 22 '14 at 17:19






Yes, I installed the unity package so that I can use the internet when I need to access webmin, phpmyadmin, etc from the server itself without having to use a different computer.
– user251124
Feb 22 '14 at 17:19












3 Answers
3






active

oldest

votes


















3














Assuming you need a CLI method:



Use your favourite editor to edit /etc/network/interfaces with root permissions.



sudo nano /etc/network/interfaces


(lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.0.100 # use the address you really want
netmask 255.255.255.0
gateway 192.168.0.254 # use the address of your router


You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



For a detailed outline see



Ubuntu Server Guide - chapter networking






share|improve this answer























  • Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
    – user251124
    Feb 22 '14 at 15:52












  • @user251124 those are only comments, ignore them)
    – guntbert
    Feb 22 '14 at 15:57










  • No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
    – user251124
    Feb 22 '14 at 16:01












  • @user251124 see my changed answer please.
    – guntbert
    Feb 22 '14 at 16:06










  • @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
    – douggro
    Feb 22 '14 at 16:13



















0














There is a special loopback address (127.0.0.1) that always points to your own computer. If you have Webmin (I'm not familiar with this program) listening on port 8080 on your computer, you can just go to 127.0.0.1:8080.



Edit: My bad. I was under the impression that you wanted to access the services from your own computer.






share|improve this answer





















  • He wants access from outside his LAN.
    – guntbert
    Feb 22 '14 at 15:38










  • Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
    – saiarcot895
    Feb 22 '14 at 15:40










  • Yes, for the public address, but no for the forwarding (done on the router).
    – guntbert
    Feb 22 '14 at 15:47










  • @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
    – douggro
    Feb 22 '14 at 16:21



















0














With Ubuntu 18.04 LTS, the infrastructure to set Local IP has shifted to Netplan



Go to this link for details how to configure IP Address with Netplan on Ubuntu 18.04!



Briefly, you need to modify the relevant netplan network configuration file within /etc/netplan/ directory as follows:

network:
ethernets:
enp2s0: #Your network interface
addresses:
- 192.168.0.100/24 #Change to your required IP
dhcp4: false
gateway4: 192.168.1.1
nameservers:
addresses:
- 192.168.1.1
search:
version: 2






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f424666%2fhow-to-change-your-local-ip%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    Assuming you need a CLI method:



    Use your favourite editor to edit /etc/network/interfaces with root permissions.



    sudo nano /etc/network/interfaces


    (lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.0.100 # use the address you really want
    netmask 255.255.255.0
    gateway 192.168.0.254 # use the address of your router


    You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



    For a detailed outline see



    Ubuntu Server Guide - chapter networking






    share|improve this answer























    • Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
      – user251124
      Feb 22 '14 at 15:52












    • @user251124 those are only comments, ignore them)
      – guntbert
      Feb 22 '14 at 15:57










    • No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
      – user251124
      Feb 22 '14 at 16:01












    • @user251124 see my changed answer please.
      – guntbert
      Feb 22 '14 at 16:06










    • @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
      – douggro
      Feb 22 '14 at 16:13
















    3














    Assuming you need a CLI method:



    Use your favourite editor to edit /etc/network/interfaces with root permissions.



    sudo nano /etc/network/interfaces


    (lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.0.100 # use the address you really want
    netmask 255.255.255.0
    gateway 192.168.0.254 # use the address of your router


    You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



    For a detailed outline see



    Ubuntu Server Guide - chapter networking






    share|improve this answer























    • Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
      – user251124
      Feb 22 '14 at 15:52












    • @user251124 those are only comments, ignore them)
      – guntbert
      Feb 22 '14 at 15:57










    • No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
      – user251124
      Feb 22 '14 at 16:01












    • @user251124 see my changed answer please.
      – guntbert
      Feb 22 '14 at 16:06










    • @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
      – douggro
      Feb 22 '14 at 16:13














    3












    3








    3






    Assuming you need a CLI method:



    Use your favourite editor to edit /etc/network/interfaces with root permissions.



    sudo nano /etc/network/interfaces


    (lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.0.100 # use the address you really want
    netmask 255.255.255.0
    gateway 192.168.0.254 # use the address of your router


    You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



    For a detailed outline see



    Ubuntu Server Guide - chapter networking






    share|improve this answer














    Assuming you need a CLI method:



    Use your favourite editor to edit /etc/network/interfaces with root permissions.



    sudo nano /etc/network/interfaces


    (lines starting with # are just comments, they are not effective, you can leave them as they are, you also keep the lines with lo as they are)



    # The loopback network interface
    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.0.100 # use the address you really want
    netmask 255.255.255.0
    gateway 192.168.0.254 # use the address of your router


    You will have to restart the interface sudo ifdown eth0 (may throw an error, ignore that), then sudo ifup etho - you can check if the settings are effective with ip ad.



    For a detailed outline see



    Ubuntu Server Guide - chapter networking







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Feb 22 '14 at 16:06

























    answered Feb 22 '14 at 15:45









    guntbert

    9,078133069




    9,078133069












    • Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
      – user251124
      Feb 22 '14 at 15:52












    • @user251124 those are only comments, ignore them)
      – guntbert
      Feb 22 '14 at 15:57










    • No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
      – user251124
      Feb 22 '14 at 16:01












    • @user251124 see my changed answer please.
      – guntbert
      Feb 22 '14 at 16:06










    • @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
      – douggro
      Feb 22 '14 at 16:13


















    • Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
      – user251124
      Feb 22 '14 at 15:52












    • @user251124 those are only comments, ignore them)
      – guntbert
      Feb 22 '14 at 15:57










    • No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
      – user251124
      Feb 22 '14 at 16:01












    • @user251124 see my changed answer please.
      – guntbert
      Feb 22 '14 at 16:06










    • @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
      – douggro
      Feb 22 '14 at 16:13
















    Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
    – user251124
    Feb 22 '14 at 15:52






    Hi, my interfaces file has a different layout than the one shown in your comment. Mine looks like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface #NetworkManager#auto wlan0 #NetworkManager#iface wlan0 inet dhcp #NetworkManager# wpa-ssid routernamehere #NetworkManager# wpa-psk routerpasswordhere
    – user251124
    Feb 22 '14 at 15:52














    @user251124 those are only comments, ignore them)
    – guntbert
    Feb 22 '14 at 15:57




    @user251124 those are only comments, ignore them)
    – guntbert
    Feb 22 '14 at 15:57












    No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
    – user251124
    Feb 22 '14 at 16:01






    No luck so far. I replaced the auto lo etcetcetc with what you suggested, however, it still doesn't work. Just to clarift, the address I really want is the server's local ip and "the adderss of your router" is the local ip of the router or the wi-fi ip?
    – user251124
    Feb 22 '14 at 16:01














    @user251124 see my changed answer please.
    – guntbert
    Feb 22 '14 at 16:06




    @user251124 see my changed answer please.
    – guntbert
    Feb 22 '14 at 16:06












    @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
    – douggro
    Feb 22 '14 at 16:13




    @guntbert This would work fine if the address is within the LAN address range allocated in the router. It would be far more effective to use a DHCP reservation in the router via MAC address for the Ethernet connection and run the port-forwarding to that LAN IP address.
    – douggro
    Feb 22 '14 at 16:13













    0














    There is a special loopback address (127.0.0.1) that always points to your own computer. If you have Webmin (I'm not familiar with this program) listening on port 8080 on your computer, you can just go to 127.0.0.1:8080.



    Edit: My bad. I was under the impression that you wanted to access the services from your own computer.






    share|improve this answer





















    • He wants access from outside his LAN.
      – guntbert
      Feb 22 '14 at 15:38










    • Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
      – saiarcot895
      Feb 22 '14 at 15:40










    • Yes, for the public address, but no for the forwarding (done on the router).
      – guntbert
      Feb 22 '14 at 15:47










    • @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
      – douggro
      Feb 22 '14 at 16:21
















    0














    There is a special loopback address (127.0.0.1) that always points to your own computer. If you have Webmin (I'm not familiar with this program) listening on port 8080 on your computer, you can just go to 127.0.0.1:8080.



    Edit: My bad. I was under the impression that you wanted to access the services from your own computer.






    share|improve this answer





















    • He wants access from outside his LAN.
      – guntbert
      Feb 22 '14 at 15:38










    • Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
      – saiarcot895
      Feb 22 '14 at 15:40










    • Yes, for the public address, but no for the forwarding (done on the router).
      – guntbert
      Feb 22 '14 at 15:47










    • @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
      – douggro
      Feb 22 '14 at 16:21














    0












    0








    0






    There is a special loopback address (127.0.0.1) that always points to your own computer. If you have Webmin (I'm not familiar with this program) listening on port 8080 on your computer, you can just go to 127.0.0.1:8080.



    Edit: My bad. I was under the impression that you wanted to access the services from your own computer.






    share|improve this answer












    There is a special loopback address (127.0.0.1) that always points to your own computer. If you have Webmin (I'm not familiar with this program) listening on port 8080 on your computer, you can just go to 127.0.0.1:8080.



    Edit: My bad. I was under the impression that you wanted to access the services from your own computer.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 22 '14 at 15:37









    saiarcot895

    9,40422233




    9,40422233












    • He wants access from outside his LAN.
      – guntbert
      Feb 22 '14 at 15:38










    • Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
      – saiarcot895
      Feb 22 '14 at 15:40










    • Yes, for the public address, but no for the forwarding (done on the router).
      – guntbert
      Feb 22 '14 at 15:47










    • @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
      – douggro
      Feb 22 '14 at 16:21


















    • He wants access from outside his LAN.
      – guntbert
      Feb 22 '14 at 15:38










    • Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
      – saiarcot895
      Feb 22 '14 at 15:40










    • Yes, for the public address, but no for the forwarding (done on the router).
      – guntbert
      Feb 22 '14 at 15:47










    • @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
      – douggro
      Feb 22 '14 at 16:21
















    He wants access from outside his LAN.
    – guntbert
    Feb 22 '14 at 15:38




    He wants access from outside his LAN.
    – guntbert
    Feb 22 '14 at 15:38












    Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
    – saiarcot895
    Feb 22 '14 at 15:40




    Ah, ok. I thought he meant from his own computer. But wouldn't the public IP address stay the same while the private IP address changes (a change in router port-forwarding, then)?
    – saiarcot895
    Feb 22 '14 at 15:40












    Yes, for the public address, but no for the forwarding (done on the router).
    – guntbert
    Feb 22 '14 at 15:47




    Yes, for the public address, but no for the forwarding (done on the router).
    – guntbert
    Feb 22 '14 at 15:47












    @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
    – douggro
    Feb 22 '14 at 16:21




    @saiarcot895 Just FYI - Webmin listens on port 10000 https://localhost:10000
    – douggro
    Feb 22 '14 at 16:21











    0














    With Ubuntu 18.04 LTS, the infrastructure to set Local IP has shifted to Netplan



    Go to this link for details how to configure IP Address with Netplan on Ubuntu 18.04!



    Briefly, you need to modify the relevant netplan network configuration file within /etc/netplan/ directory as follows:

    network:
    ethernets:
    enp2s0: #Your network interface
    addresses:
    - 192.168.0.100/24 #Change to your required IP
    dhcp4: false
    gateway4: 192.168.1.1
    nameservers:
    addresses:
    - 192.168.1.1
    search:
    version: 2






    share|improve this answer




























      0














      With Ubuntu 18.04 LTS, the infrastructure to set Local IP has shifted to Netplan



      Go to this link for details how to configure IP Address with Netplan on Ubuntu 18.04!



      Briefly, you need to modify the relevant netplan network configuration file within /etc/netplan/ directory as follows:

      network:
      ethernets:
      enp2s0: #Your network interface
      addresses:
      - 192.168.0.100/24 #Change to your required IP
      dhcp4: false
      gateway4: 192.168.1.1
      nameservers:
      addresses:
      - 192.168.1.1
      search:
      version: 2






      share|improve this answer


























        0












        0








        0






        With Ubuntu 18.04 LTS, the infrastructure to set Local IP has shifted to Netplan



        Go to this link for details how to configure IP Address with Netplan on Ubuntu 18.04!



        Briefly, you need to modify the relevant netplan network configuration file within /etc/netplan/ directory as follows:

        network:
        ethernets:
        enp2s0: #Your network interface
        addresses:
        - 192.168.0.100/24 #Change to your required IP
        dhcp4: false
        gateway4: 192.168.1.1
        nameservers:
        addresses:
        - 192.168.1.1
        search:
        version: 2






        share|improve this answer














        With Ubuntu 18.04 LTS, the infrastructure to set Local IP has shifted to Netplan



        Go to this link for details how to configure IP Address with Netplan on Ubuntu 18.04!



        Briefly, you need to modify the relevant netplan network configuration file within /etc/netplan/ directory as follows:

        network:
        ethernets:
        enp2s0: #Your network interface
        addresses:
        - 192.168.0.100/24 #Change to your required IP
        dhcp4: false
        gateway4: 192.168.1.1
        nameservers:
        addresses:
        - 192.168.1.1
        search:
        version: 2







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 11 at 14:54

























        answered Dec 11 at 14:46









        Rabi

        11




        11






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f424666%2fhow-to-change-your-local-ip%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕