How to Add or Change the Default Port on Linux

Use Terminal

How to Add or Change the Default Port on Linux Picture 1

Open the Terminal application. You can open Terminal from the sidebar, or press Ctrl+ Alt+ T.

How to Add or Change the Default Port on Linux Picture 2

View the current default gateway. You can check which default gateway is installed by typing routeand pressing ↵ Enter. The address next to the word "default" is your default gateway and the interface to which it is assigned will be displayed on the right side of the table.

How to Add or Change the Default Port on Linux Picture 3

Delete the current default gateway. If the computer has multiple default ports set up, connection conflicts may occur. If you want to change your router's current IP address, you should delete it first.

Enter command . For example, to delete the default gateway 10.0.2.2 on the routersudo route delete default gw IP Address Adaptereth0, you type sudo route delete default gw 10.0.2.2 eth0.

How to Add or Change the Default Port on Linux Picture 4

Enter command. . For example, if you want to change the IP address of your routersudo route add default gw IP Address Adaptereth0to 192.168.1.254, type sudo route add default gw 192.168.1.254 eth0. You will be asked to enter your user password to complete the command.

Edit configuration file

How to Add or Change the Default Port on Linux Picture 5

Open the configuration file with an editor. Type the command sudo nano /etc/network/interfacesto open the file in Nano software. Editing system files will preserve your changes every time your computer restarts.

How to Add or Change the Default Port on Linux Picture 6

Navigate to the appropriate section. Find the section about the router whose IP address you want to change. For a wired connection, a router is usuallyeth0.

How to Add or Change the Default Port on Linux Picture 7

More . into this section. For example, type to set the default gateway to 192.168.1.254.gateway IP Addressgateway 192.168.1.254

How to Add or Change the Default Port on Linux Picture 8

Save your changes and exit. Press Ctrl+ Xthen press key Yto save changes and exit.

How to Add or Change the Default Port on Linux Picture 9

Restart the network. Restart your network by typing the command sudo /etc/init.d/networking restart.

4 ★ | 2 Vote

May be interested

  • Fix USB not working in LinuxFix USB not working in Linux
    you have connected a usb or keyboard or mouse to your linux pc, but it doesn't work. what's happening? why can't my linux device detect my device?
  • What is UID in Linux? How to find and change the UIDWhat is UID in Linux? How to find and change the UID
    if you've ever interacted with linux systems, chances are you've come across these two words, uid and gid. if you are not familiar with them, let's dig deeper through the following article.
  • Instructions to change Port value on routerInstructions to change Port value on router
    we have conducted many tests on the process of accessing data files from inside and outside your network. and in the article below, we continue to mention the problem that many people have trouble getting started, that is forward port on the router.
  • How to set the default browser when opening any link on the computerHow to set the default browser when opening any link on the computer
    setting the default browser on your computer allows you to open links from other applications using your favorite browser. if you do not change the default browser to your liking, the windows default browser is internet explorer. if you install chrome, firefox or coc coc and want to set them as the default browser, please see the instructions below.
  • What is AAA PC Port? Why do they have so many problems?What is AAA PC Port? Why do they have so many problems?
    big companies often make aaa games on consoles. however, when they port these games to pc (called porting process), they often run into a ton of problems.
  • How to change default browser and email on iPhoneHow to change default browser and email on iPhone
    to set your preferred web browser as your default on ios 14, follow these steps. go to settings > scroll down and click on any browser you have installed on your iphone, for example here i choose chrome.
  • How to connect printer 2.0 USB port to USB 3.0 port on Windows 10How to connect printer 2.0 USB port to USB 3.0 port on Windows 10
    the following article will guide you how to connect the usb 2.0 port of the printer to the usb 3.0 port on your computer. if you are having a similar problem, try it now!
  • Summary of some simple ways to disable USB ports on Windows computersSummary of some simple ways to disable USB ports on Windows computers
    you can imagine that usb ports are like door scenes, and other users or malware, viruses can spread and access your system anytime through this path. so to protect important data on your windows computer, you can disable the usb port.
  • How to change Google DNS on LinuxHow to change Google DNS on Linux
    in the previous article, tipsmake.com showed you how to change google dns on a mac. today, let's find out how to change dns on linux and its distributions.
  • How to change the default browser on AndroidHow to change the default browser on Android
    browsers on smartphones in general and on android in particular are usually quite simple and do not have many useful features like google chrome, firefox or dolphin, ... instead of using the default browser available in your computer completely can change as you like to enhance your experience when using.