Prosíme přihlašte se nebo zaregistrujte.

Přihlašte se svým uživatelským jménem a heslem.
Vaše pomoc je stále potřeba!

Autor Téma: Default gw  (Přečteno 5148 krát)

nitta

  • Návštěvník
  • Příspěvků: 17
Default gw
« kdy: 02 Února 2023, 11:07:55 »
Ahoj,
prosím o radu kde v Ubuntu 21.04 nastavit default gw aby pravidlo platilo po restartu.
Config interfaces (/etc/network/interfaces) tam nemám.
Díky za info.

ramael

  • Stálý člen
  • **
  • Příspěvků: 638
Re:Default gw
« Odpověď #1 kdy: 05 Února 2023, 07:51:04 »
Lenovo: ThinkPad X380 Yoga
Joutůůůůb

simoneraineop

  • Návštěvník
  • Příspěvků: 1
Re:Default gw
« Odpověď #2 kdy: 24 Října 2023, 09:54:10 »
In Ubuntu 17.04 and later, including Ubuntu 21.04, network configuration has been managed using Netplan. You can set the default gateway in Ubuntu 21.04 by configuring Netplan. Here's how you can do it:

First, you need to determine the name of your network interface. You can do this by running the following command:

bash
Copy code
ip a
Look for the interface that you're using for your internet connection (e.g., eth0, enp0s3, or wlan0). Note down the interface name.

Create a .yaml configuration file in the /etc/netplan/ directory. You can use a text editor to create a configuration file. For example, you can use the nano text editor:

bash
Copy code
sudo nano /etc/netplan/99-custom-gateway.yaml
Replace 99-custom-gateway.yaml with a filename of your choice, but make sure it ends with the .yaml extension.

In the configuration file, you need to specify the network configuration. For example, if your interface name is eth0, you can create a configuration file like this:

yaml
Copy code
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - your_ip_address/your_subnet_mask
      gateway4: your_gateway_ip
Replace eth0, your_ip_address, your_subnet_mask, and your_gateway_ip with your actual network configuration. If you're using DHCP for address assignment, set dhcp4 to yes.

Save the file and exit the text editor.

Apply the configuration changes by running:

bash
Copy code
sudo netplan apply
Reboot your system to ensure that the changes persist after a restart:

bash
Copy code
sudo reboot
Your default gateway should now be set, and it will persist after a restart. Please be sure to replace the placeholder values in the YAML configuration file with your actual network configuration details.


krogerfeedbacktellthebellmycfavisitdgcustomerfirsthelpmeloginbazoocam

 

Provoz zaštiťuje spolek OpenAlt.