TechBeamersTechBeamers
  • Learn ProgrammingLearn Programming
    • Python Programming
      • Python Basic
      • Python OOP
      • Python Pandas
      • Python PIP
      • Python Advanced
      • Python Selenium
    • Python Examples
    • Selenium Tutorials
      • Selenium with Java
      • Selenium with Python
    • Software Testing Tutorials
    • Java Programming
      • Java Basic
      • Java Flow Control
      • Java OOP
    • C Programming
    • Linux Commands
    • MySQL Commands
    • Agile in Software
    • AngularJS Guides
    • Android Tutorials
  • Interview PrepInterview Prep
    • SQL Interview Questions
    • Testing Interview Q&A
    • Python Interview Q&A
    • Selenium Interview Q&A
    • C Sharp Interview Q&A
    • PHP Interview Questions
    • Java Interview Questions
    • Web Development Q&A
  • Self AssessmentSelf Assessment
    • Python Test
    • Java Online Test
    • Selenium Quiz
    • Testing Quiz
    • HTML CSS Quiz
    • Shell Script Test
    • C/C++ Coding Test
Search
  • Python Multiline String
  • Python Multiline Comment
  • Python Iterate String
  • Python Dictionary
  • Python Lists
  • Python List Contains
  • Page Object Model
  • TestNG Annotations
  • Python Function Quiz
  • Python String Quiz
  • Python OOP Test
  • Java Spring Test
  • Java Collection Quiz
  • JavaScript Skill Test
  • Selenium Skill Test
  • Selenium Python Quiz
  • Shell Scripting Test
  • Latest Python Q&A
  • CSharp Coding Q&A
  • SQL Query Question
  • Top Selenium Q&A
  • Top QA Questions
  • Latest Testing Q&A
  • REST API Questions
  • Linux Interview Q&A
  • Shell Script Questions
© 2024 TechBeamers. All Rights Reserved.
Reading: Set Static IP on Windows, Ubuntu & OS X
Font ResizerAa
TechBeamersTechBeamers
Font ResizerAa
  • Python
  • SQL
  • C
  • Java
  • Testing
  • Selenium
  • Agile Concepts Simplified
  • Linux
  • MySQL
  • Python Quizzes
  • Java Quiz
  • Testing Quiz
  • Shell Script Quiz
  • WebDev Interview
  • Python Basic
  • Python Examples
  • Python Advanced
  • Python OOP
  • Python Selenium
  • General Tech
Search
  • Programming Tutorials
    • Python Tutorial
    • Python Examples
    • Java Tutorial
    • C Tutorial
    • MySQL Tutorial
    • Selenium Tutorial
    • Testing Tutorial
  • Top Interview Q&A
    • SQL Interview
    • Web Dev Interview
  • Best Coding Quiz
    • Python Quizzes
    • Java Quiz
    • Testing Quiz
    • ShellScript Quiz
Follow US
© 2024 TechBeamers. All Rights Reserved.
Linux Tutorials

Set Static IP on Windows, Ubuntu & OS X

Last updated: Feb 25, 2024 11:04 am
By Meenakshi Agarwal
Share
1 Min Read
Configure Static IP on Windows, Ubuntu & OS X
SHARE

Setting a static IP address ensures your computer always uses the same IP, useful for network stability and certain applications. This tutorial will guide you through the process on Windows 7, Ubuntu 14, and OS X 10.

Contents
How to Set a Static IP on Windows?Using the Control PanelUsing the Command PromptHow to Set a Static IP on UbuntuUsing the Network ManagerUsing the Command LineHow to Set a Static IP on OS X 10

What is a Static IP Address?

A static IP address is a fixed IP address that is assigned to a device on a network. This is in contrast to a dynamic IP address, which is assigned to a device by a DHCP server.

Static IP addresses are often used for servers and other devices that need to be accessible from other devices on the network at all times.

While you are on your way to set the static IP address, ensure you have the required access to do so. In most cases, you will require either an admin or root access to perform such operations.

Let’s now dive into learning the techniques lined up in this tutorial.

Also Read: How to Install MySQL on Ubuntu and Debian OS

How to Set a Static IP on Windows?

There are two ways to set a static IP on Windows.

Network Settings on Windows

Using the Control Panel

  1. Open the Control Panel.
  2. Click “Network and Internet”.
  3. Click “Network and Sharing Center”.
  4. Click “Change adapter settings”.
  5. Right-click on the network adapter for which you want to set the static IP address and select “Properties”.
  6. Click the “Internet Protocol Version 4 (TCP/IPv4)” checkbox and then click “Properties”.
  7. Select the “Use the following IP address” radio button and enter the IP address, subnet mask, gateway address, and DNS server addresses that you want to use.
  8. Click “OK” to save your changes.

Using the Command Prompt

  1. Open a command prompt window.
  2. Type the following command and press Enter:
netsh interface ip show config

This will display a list of all the network adapters on your computer.

  1. Identify the name of the network adapter for which you want to set the static IP address.
  2. Type the following command and press Enter, replacing `<network_adapter_name>` with the name of the network adapter that you identified in step 3:
netsh interface ip set address <network_adapter_name> static <ip_address> <subnet_mask> <gateway_address> <dns_server_address>

Replace <ip_address>, <subnet_mask>, <gateway_address>, and <dns_server_address> with the IP address, subnet mask, gateway address, and DNS server address that you want to use.

  1. Click “OK” to save your changes.

Must Read: 30 Linux Questions One Should Know for Interview

How to Set a Static IP on Ubuntu

There are two ways to set a static IP on Ubuntu:

windows configuration

Using the Network Manager

  1. Click the network icon in the top right corner of the screen and select “Edit Connections”.
  2. Select the network connection for which you want to set the static IP address and click “Edit”.
  3. Click the “IPv4 Settings” tab.
  4. Select the “Manual” method.
  5. Enter the IP address, subnet mask, gateway address, and DNS server addresses that you want to use.
  6. Click “Save”.

Using the Command Line

  1. Open a terminal window.
  2. Type the following command and press Enter:
sudo nano /etc/network/interfaces

This will open the network interfaces configuration file in a text editor.

  1. Find the section for the network interface for which you want to set the static IP address.
  2. Make sure that the following lines are uncommented:
iface <network_interface_name> inet static
address <ip_address>
netmask <subnet_mask>
gateway <gateway_address>

Replace <network_interface_name>, <ip_address>, <subnet_mask>, and <gateway_address> with the name of the network interface, IP address, subnet mask, and gateway address that you want to use.

  1. Save the file and exit the text editor.
  2. Restart the networking service by running the following command:
sudo service networking restart

Do you know what is a static method in Python? Check out.

How to Set a Static IP on OS X 10

To set a static IP on OS X 10, follow these steps:

Set IP Address on Mac OS X
  1. Open System Preferences.
  2. Click “Network”.
  3. Select the network connection for which you want to set the static IP address and click “Advanced”.
  4. Click the “TCP/IP” tab.
  5. Select the “Manually” option.
  6. Enter the IP address, subnet mask, gateway address, and DNS server addresses that you want to use.
  7. Click “OK” to save your changes.

Conclusion

In this tutorial, we’ve shown you how to set a static IP address on Windows, Ubuntu, and OS X. By following these steps, you can achieve network stability and tailor your device’s connection to your specific needs.

Remember to use a static IP responsibly and ensure it doesn’t conflict with other devices on your network. If you want us to cover a topic of your choice, let us know. Hit the comment box and write your wish. We’ll certainly publish it next.

Happy Learning!

You Might Also Like

Basic Linux Commands for Beginners With Examples

How to Use Bash to Replace Character in String

Simple Bash Scripting Tutorial for Beginners

20 Bash Script Code Challenges for Beginners with Their Solutions

Difference Between Git Repository and Directory

TAGGED:Unix Commands and Concepts
Meenakshi Agarwal Avatar
By Meenakshi Agarwal
Follow:
Hi, I'm Meenakshi Agarwal. I have a Bachelor's degree in Computer Science and a Master's degree in Computer Applications. After spending over a decade in large MNCs, I gained extensive experience in programming, coding, software development, testing, and automation. Now, I share my knowledge through tutorials, quizzes, and interview questions on Python, Java, Selenium, SQL, and C# on my blog, TechBeamers.com.
Previous Article Test Automation Frameworks Seven Types of Test Automation Frameworks
Next Article Linux service using shell script. Universal Linux Service Example Using Shell Script

Popular Tutorials

SQL Interview Questions List
50 SQL Practice Questions for Good Results in Interview
SQL Interview Nov 01, 2016
Demo Websites You Need to Practice Selenium
7 Sites to Practice Selenium for Free in 2024
Selenium Tutorial Feb 08, 2016
SQL Exercises with Sample Table and Demo Data
SQL Exercises – Complex Queries
SQL Interview May 10, 2020
Java Coding Questions for Software Testers
15 Java Coding Questions for Testers
Selenium Tutorial Jun 17, 2016
30 Quick Python Programming Questions On List, Tuple & Dictionary
30 Python Programming Questions On List, Tuple, and Dictionary
Python Basic Python Tutorials Oct 07, 2016
//
Our tutorials are written by real people who’ve put in the time to research and test thoroughly. Whether you’re a beginner or a pro, our tutorials will guide you through everything you need to learn a programming language.

Top Coding Tips

  • PYTHON TIPS
  • PANDAS TIPSNew
  • DATA ANALYSIS TIPS
  • SELENIUM TIPS
  • C CODING TIPS
  • GDB DEBUG TIPS
  • SQL TIPS & TRICKS

Top Tutorials

  • PYTHON TUTORIAL FOR BEGINNERS
  • SELENIUM WEBDRIVER TUTORIAL
  • SELENIUM PYTHON TUTORIAL
  • SELENIUM DEMO WEBSITESHot
  • TESTNG TUTORIALS FOR BEGINNERS
  • PYTHON MULTITHREADING TUTORIAL
  • JAVA MULTITHREADING TUTORIAL

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

Loading
TechBeamersTechBeamers
Follow US
© 2024 TechBeamers. All Rights Reserved.
  • About
  • Contact
  • Disclaimer
  • Privacy Policy
  • Terms of Use
TechBeamers Newsletter - Subscribe for Latest Updates
Join Us!

Subscribe to our newsletter and never miss the latest tech tutorials, quizzes, and tips.

Loading
Zero spam, Unsubscribe at any time.
x