Skip to content

How To Blog

  • How to Hack Your Cell Phone Computer Tips
  • Battle of the Smart Home Hubs – SmartThings vs Wink Smart Home
  • Army Physical Fitness Test (APFT Calculator )

    Best apft standards .APFT Calculator.Soldiers have two minutes to complete because many sit-ups as possible. They must do all three events in the same test period. If many soldiers should be tested, staggered starting times ought to be planned to permit the correct intervals between events. They need to score at least a 60 to...<p class="more-link-wrap"><a href="https://blog.pkrtousd.gb.net/army-physical-fitness-test-apft-calculator/" class="more-link">Read More<span class="screen-reader-text"> “Army Physical Fitness Test (APFT Calculator )”</span> »</a></p>

  • 7 Best Live TV Streaming Services To Drop Cable For Good

    7 Best Live TV Streaming Services To Drop Cable For Good

  • Best victor calculator 2020 black
  • 7 best sites to get free wallpaper for iphone 2022 iPhone
  • The 4 Best Smart Medical Wearables (of CES 2020) Gadgets
  • What is COM Surrogate in Windows 10 and Is It a Virus? Windows 10

3 Ways To Setup Static IP Address in Ubuntu

Posted on September 14, 2021 By blog_786 No Comments on 3 Ways To Setup Static IP Address in Ubuntu

3 Ways To Setup Static IP Address in Ubuntu.

Assigning static IP addresses to each network device can be cumbersome. We advise you to do this on your router as it makes things easier. However, assigning a static IP address at the device level will override the router settings. Moreover, there are times when you do not have access to the router. For these scenarios, we have a detailed article on how to assign a static IP address to various devices. We’ll take a look at Ubuntu separately as it has so much more complexity.

So here are 3 ways to set static IP in Ubuntu or any Unix based OS.

3 Ways To Setup Static IP Address in Ubuntu

1. Setup Ubuntu static IP address using the GUI

Here we’ll be using Ubuntu for the demonstration. But most of the configuration and settings will be similar to any Unix-based OS.

So, there are several ways to deal with the network manager, the simplest of which is the graphical interface. If you are new to Ubuntu and don’t like the command line, I would suggest changing it through the GUI. First, we’ll need a subnet mask before we start setting up a static IP address. To get these values, right-click anywhere on the desktop to open a terminal.

3 Ways To Setup Static IP Address in Ubuntu

When the terminal window opens, we need to run the following command. ifconfig -a

Make a note of the netmask and inet value that we will need in the next steps. In my case, the inet value is 10.0.2.15 and the netmask is 255.0.0.0.

3 Ways To Setup Static IP Address in Ubuntu

After you have written down the subnet mask, we also need the gateway address. This is usually the first address on the network, but to be sure, let’s just check it. Run the following command on the terminal. route -n

This command will show you the IP routing table. The first entry in the table will tell you the gateway address. In my case, the first entry is 10.0.0.1, which in turn is the gateway address.

3 Ways To Setup Static IP Address in Ubuntu

It’s pretty simple now. Open your network settings. To do this, click the network icon in the upper right corner of your desktop.

3 Ways To Setup Static IP Address in Ubuntu

Now go to the active network. I am connected via LAN cable, so for me it will be Ethernet. In case you are connected to Wi-Fi, you should get the same in the tray. Make sure you click on the active network and expand the menu to see more options. Click Wired Network Settings in the Advanced Menu to open Network Settings.

3 Ways To Setup Static IP Address in Ubuntu

When you open the Network Settings window, make sure you are on the Networking tab. Click the Options icon next to the active network to open the adapter properties.

3 Ways To Setup Static IP Address in Ubuntu

When the wired network settings popup opens, go to the IPv4 tab to change the IP settings.

3 Ways To Setup Static IP Address in Ubuntu

On the IPv4 tab, select the radio button labeled “Manual”. A new window will appear with 3 text fields – Address, Netmask and Gateway. Now, before applying the changes, we need to understand what these values ​​are.

The IP value you set must be in the range of your previous IP address. For example, if your IP address was 10.0.0.2, your static IP should be in the range 10.0.0.1 – 10.255.255.255. Likewise, if it is 192.168.16.1 then your static IP address should be in the range 192.168.16.1-192.168.16.255. If you enter values ​​outside the range of IP addresses, you may have problems connecting to the Internet.

A netmask or subnet mask is used to divide a network into subnets. In simple terms, the subnet mask determines the number of IP addresses allocated on the network. As I mentioned at the beginning of this tutorial, my subnet mask is 255.0.0.0.

Finally, the gateway is the IP address of the router. This is usually the first IP address allocated for the network, or you can find out using the route – n command as we did above. In my case, this is gateway 10.0.0.1.

Once you have all these values, you need to enter the IP address, netmask and gateway address that we wrote down earlier. After confirmation, you can click the “Apply” button to register the changes.

3 Ways To Setup Static IP Address in Ubuntu

You will need to restart the network manager again for the changes to take effect. You can do it manually via the command line by simply using the following command sudo service network-manager restart

3 Ways To Setup Static IP Address in Ubuntu

Alternatively, you can simply turn the network adapter off and on. Then run ifconfig on a terminal to check the IP address. This must be the same IP address that you specified in your IPv4 settings.

3 Ways To Setup Static IP Address in Ubuntu

2. Setup Ubuntu static IP address via command line

The fastest way to do this is through the command line. If you are good with commands, then this method should help. However, to set a static IP through the terminal, we need the subnet mask, as before, as well as the adapter name. Run ifconfig -a to get these values.

3 Ways To Setup Static IP Address in Ubuntu

After receiving the values, run the following command. sudo ifconfig enp0s3 10.0.0.3 netmask 255.0.0.0

In this command eng0s3 should be replaced with the name of your adapter; 10.0.0.3 at your static IP followed by a netmask.

3 Ways To Setup Static IP Address in Ubuntu

When you run the following command, the entry will not be written to the config file. It is not standard practice if you are managing the server.

3. Set Ubuntu static IP address via configuration file

The problem with all the above methods is that you don’t have any documented stuff. It is absolutely not recommended to make changes in this way on the server. The recommended way is to edit the config file. This way, all changes are documented and you can simply undo the previous change by commenting out the lines.

The configuration file is / etc / network / interface. You need administrator rights to edit this file. But first, we need a lot of values, such as subnet mask, gateway address, broadcast address, and adapter name. Just run ifconfig -a on a terminal to get the adapter name, subnet mask, and broadcast address values.

3 Ways To Setup Static IP Address in Ubuntu

For the gateway address, run the following command on the terminal. route -n

This command will show you the IP routing table. The first entry in the table will tell you the gateway address. In my case, the first entry is 10.0.0.1, which in turn is the gateway address.

3 Ways To Setup Static IP Address in Ubuntu

Now we need to open the config file to make changes. To do this, run the following command. Sudo vi / etc / network / interface

If you are not familiar with vi editor and controls, you can also use gedit. gedit is a graphical interface for editing files. To open the file in gedit run the following command sudo gedit / etc / network / interface

3 Ways To Setup Static IP Address in Ubuntu

After opening the file, it should be empty or have previous configurations. If you have the configurations defined earlier, just comment them out instead of deleting them. Prefix all lines with “#”, and now the lines will become useless. Now we need the adapter name, subnet mask, and broadcast address that we wrote down earlier.

Press “i” if you are using vi to enter insert mode. Enter the following code and replace the values ​​accordingly with your own values.

auto enp0s3
iface enp0s3 inet static
address 10.0.0.6
netmask 255.255.255.0
net 10.0.0.1
broadcast 10.0.0.255
gateway 10.0.0.1

But before entering these lines, you need to understand the code. “Auto enp0s3” will automatically restart the interface when the system boots. Iface enp0s3 is a suffix to define the enp0s3 interface. “Inet” refers to IPv4 and “inet static” refers to specifying a static IP address for the specified network adapter. The rest of the lines speak for themselves.

If you want to revert to DHCP, you can change it to “inet dhcp”.

3 Ways To Setup Static IP Address in Ubuntu

After successfully adding the code, press Esc and enter “: wq” to save your changes. Now we need to restart the network for the changes to take effect. Run the following command to restart the network adapter. sudo service network-manager restart

3 Ways To Setup Static IP Address in Ubuntu

After a reboot, the changes will take effect. To see the changes, run ifconfig again and view the following values. It must match the values ​​that you defined in the config file.

3 Ways To Setup Static IP Address in Ubuntu

If you want to make changes, comment out the previous lines and add the changes.

Wrap-around: Set up a static IP address in Ubuntu

If you are on a home network, the recommended method is to define static IP addresses through a router. In case of exceptions, you can try assigning a static IP address in Ubuntu through the GUI or command line. If you are managing a server, follow the guidelines and define a static IP address in the configuration file.

Once you have defined a static IP address, your device should use the specified IP address and override the changes made at the router level. Alternatively, you can try user management in Ubuntu, or try changing the GRUB 2 splash screen in Ubuntu 12.04.

If you have any problems or questions, write about it in the comments, and I will contact you.

How-To Tags:3 Ways To Setup Static IP Address in Ubuntu, address, Set Ubuntu static IP address via configuration file, Setup, Setup Ubuntu static IP address using the GUI, Setup Ubuntu static IP address via command line, Ubuntu, Ways, Wrap around Set up a static IP address in Ubuntu

Post navigation

Previous Post: How to Find IP Address of Any Device On Your Network
Next Post: How to Enable Dark Mode in Android 10

Related Posts

  • How To Deactivate Facebook Messenger How-To
  • Tips & Tricks To Effectively Browse Wikipedia How-To
  • FakeOFF: Easily Identify Fake Account on Facebook How-To
  • How to Install Chrome Browser on Android TV How-To
  • How to Configure Interrupt Request (IRQ) Priorities in Windows How-To
  • How to Set a Family Picture on your Echo Show 5 How-To

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • March 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • Linux
  • Linux Tips
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Wordpress

Recent Posts

  • Compare SurveyMonkey with Google Forms
  • How to Go Live on TikTok 2021
  • How to Make a Scatter Plot in Google Sheets 2021
  • How to Whisper on Twitch 2021
  • 11 Best useful Ways to Fix Gmail Notifications Not Working in Chrome

Recent Comments

  1. 6 Best iOS Reminder Apps 2023 - How To Blog on How to Use Facebook Custom Friends Lists To Organize Your Friends
  2. 6 Best iOS Reminder Apps 2023 - How To Blog on How To Add Audio Narration To a Powerpoint Presentation
  3. 6 Best iOS Reminder Apps 2023 - How To Blog on free online courses with certificates of completion
  4. How to permanently delete A PS4 Account - How To Blog on Ultimate Guide to Troubleshooting PS4
  5. most expensive game console 2022/23 - How To Blog on 120Hz TVs and Phones Are Here: Do You Need It?
  • How To Share An iTunes Library On Your Local Network Computer Tips
  • LinkedIn “Open to Work” Feature: Should You Use It? Computer Tips
  • The Most Common Windows 10 Error Messages & How To Fix Them Windows 10
  • Find the Best Wifi Channel on Windows Networking
  • How to Fix “Android App Not Sending Notifications” How-To
  • How to create line graphs in Google Sheets Google Software/Tips
  • Top 5 Facebook Alternative Apps For iOS Devices
  • How to Detect Invisible Users on Yahoo Messenger technology

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version