Saturday, May 6, 2017
Thursday, April 27, 2017
How to configure static ip in Ubuntu
This tutorial covered the resolution of below mentioned questions....
1. How to configure static ip in Ubuntu?
2. How to make dynamic ip to static ip?
3. How to fix the Ubuntu server address for a dynamic ip internet connection?
By default, Ubuntu server obtained IP Address automatically using DHCP. So in this tutorial we learn how to configure static IP in Ubuntu
server.
First, you need to know the id of network interface of your system and connection information. To find this information execute the
following command on Ubuntu terminal.
$ifconfig -a
In this example, assume that the configuration is for a node (interface id) "eth0".
Now, execute the following command to edit the configuration file.
$sudo nano /etc/network/interfaces
The default content of the configuration file for localhost is as mentioned below...
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
Add the following lines to the end of the configuration file. Assuming that I want to make my server's static ip as "192.168.1.8".
# external ethernet
auto eth0
iface eth0 inet static
address 192.168.1.8/24
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4
*These addresses may vary machine to machine. Please check and configure correct values.
Then, Save the file and reboot your machine.
$reboot
To test it, After reboot, OFF and then ON modem and check the IP address (Should not change the server IP Address).
1. How to configure static ip in Ubuntu?
2. How to make dynamic ip to static ip?
3. How to fix the Ubuntu server address for a dynamic ip internet connection?
By default, Ubuntu server obtained IP Address automatically using DHCP. So in this tutorial we learn how to configure static IP in Ubuntu
server.
First, you need to know the id of network interface of your system and connection information. To find this information execute the
following command on Ubuntu terminal.
$ifconfig -a
In this example, assume that the configuration is for a node (interface id) "eth0".
Now, execute the following command to edit the configuration file.
$sudo nano /etc/network/interfaces
The default content of the configuration file for localhost is as mentioned below...
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
Add the following lines to the end of the configuration file. Assuming that I want to make my server's static ip as "192.168.1.8".
# external ethernet
auto eth0
iface eth0 inet static
address 192.168.1.8/24
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8 8.8.4.4
*These addresses may vary machine to machine. Please check and configure correct values.
Then, Save the file and reboot your machine.
$reboot
To test it, After reboot, OFF and then ON modem and check the IP address (Should not change the server IP Address).
Subscribe to:
Posts (Atom)