ubuntu添加默认网关

您所在的位置:网站首页 ubuntu添加路由命令 ubuntu添加默认网关

ubuntu添加默认网关

2024-01-06 04:52| 来源: 网络整理| 查看: 265

ubuntu添加默认网关

ubuntu添加默认网关

Systems connected to the network will generally access to the internet. In order to access to the internet they need some network configuration like gateway or default gateway. In this tutorial we will examine how to add or change default gateway in Ubuntu, Debian, CentOS, Fedora, Mint, Kali operating systems.

连接到网络的系统通常可以访问Internet。 为了访问Internet,他们需要一些网络配置,例如网关或默认网关。 在本教程中,我们将研究如何在Ubuntu,Debian,CentOS,Fedora,Mint,Kali操作系统中添加或更改默认网关。

列出路由表 (List Routing Table)

Routing table is used to route IP network communication. Hosts generally uses default route to send packages which will redirect them accordingly to transmit destination. We will start by listing current routing table. We will use ip route show command like below.

路由表用于路由IP网络通信。 主机通常使用默认路由发送包,该包将相应地将其重定向到传输目标。 我们将从列出当前路由表开始。 我们将使用如下所示的ip route show命令。

$ ip route show List Routing Table List Routing Table 列出路由表

Our default gateway line is

我们的默认网关行是

default via 192.168.122.1 dev ens3

default means this line is default gateway

default表示此行是默认网关

via 192.168.122.1 specifies next hop which is default gateway IP address

通过192.168.122.1指定下一跳,这是默认网关IP地址

dev ens3 is the interface we want use to access default gateway

dev ens3是我们要用来访问默认网关的接口



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3