Set Static IP Address for Ubuntu/Debian Server
May 29, 2011
Recent Posts
- From Excel Chaos to Automated Operations: How Power Apps Transformed a Field Service Business
- Power BI vs Excel: Which Reporting Tool Is Right for Your Business?
- Smarter Call Scheduling with Power Automate, SharePoint and Microsoft Teams
- We’re Heading to the Odoo Business Show in Birmingham: Here’s What We Want to Talk About
- Only One in Six UK Businesses Are Using AI. Is Manufacturing Falling Behind?
Want to make your Microsoft 365 work harder for your business?
and we’ll tailor a solution that’s just right for you.
[vc_row][vc_column][vc_column_text]If you install an Ubuntu/Debian server, by default, it is only set up with DHCP and hence it fetches an IP address automatically from the DHCP server. In order to change the DHCP IP address to a static IP address you can edit /etc/network/interfaces file of your server and set it to static IP address as follows:
Content of original file:
{code}
# 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
auto eth0
iface eth0 inet dhcp
{/code}
Now, remove dhcp and change it to static. Below that enter the details of your static IP address.
Updated interfaces file:
{code}
# 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
auto eth0
iface eth0 inet static
address 10.0.0.243
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
{/code}[/vc_column_text][/vc_column][/vc_row]
