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

  • How to Change Time Zone on LinuxPhoto of How to Change Time Zone on Linux
    today's tipsmake will show you how to change the time zone on your linux computer. you can change the time zone on any linux distribution using the command line or command line menu depending on the linux version. if you are using mint, ubuntu or another distribution with a simple user interface and settings menu, you can also change the time zone right here.
  • How to Use Wine on LinuxPhoto of How to Use Wine on Linux
    today's tipsmake will show you how to install and launch wine on a linux computer. the wine program allows users to run the windows operating system on computers using other operating systems.
  • How to Ping on LinuxPhoto of How to Ping on Linux
    today's tipsmake will show you how to test the connection between a linux computer and another computer using the 'ping' command. you can also use an advanced version of the 'ping' command called 'traceroute' to see which different ip addresses a computer requires to be routed to in order to reach another computer address.
  • How to Set Up an FTP Server on Ubuntu LinuxPhoto of How to Set Up an FTP Server on Ubuntu Linux
    today's tipsmake will guide you how to set up and connect to an ftp server on a computer running the ubuntu linux operating system. ftp servers are useful for storing data from your computer and allowing others to browse those files. to establish a connection from a computer, you need an ftp server. you also need to update to the latest version of ubuntu.
  • How to Get Full Root Privileges in LinuxPhoto of How to Get Full Root Privileges in Linux
    the 'root' account on a computer using the linux operating system is an account with full authority. to operate commands on linux, especially commands that affect system files, we often need root access or privileged access. with great power, unlike regular usage permissions, root access should only be requested when necessary. thanks to that, important system files can avoid unwanted damage.
  • How to Hack Wi Fi WPA/WPA2 with Kali LinuxPhoto of How to Hack Wi Fi WPA/WPA2 with Kali Linux
    today's tipsmake will show you how to crack (hack) a wpa or wpa2 network password using kali linux.