Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to add and delete gateways in Linux system

Shulou Source: shulou.com Published: 2022-06-03 00:06:38 10月20日 Update

How to add and delete gateways in Linux system:

1. Temporarily add Gateway

Route add default gw x.x.x.x temporarily adds gateway, effective immediately

two。 Permanently add a gateway:

Vim / etc/sysconfig/network-scripts/ifcfg-eth0GATEWAY=x.x.x.x or vim / etc/rc.local..route add default gw x.x.x.x

Note:

Add a gateway can only add an IP in your existing routing network segment. Add a gateway without specifying the subnet mask (because it is the ip of an existing network segment, so the mask has been confirmed) how to delete the gateway route del default gw x.x.x.x temporarily delete the gateway, effective immediately

Tags: Gateway x.x.x.x network segment immediate system no routing subnet permanent Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MariaDB Huawei vpn Apple