Debian10查看网关地址

Debian10查看网关地址

ip route show

可写为:

  • ip route show
  • ip route sho
  • ip route sh
  • ip route s
  • ip route
  • ip rout
  • ip rou
  • ip ro
  • ip r
  • ip r s
  • ip r sh
  • ip r sho
  • ip r show
  • ip ro show
  • ip rou show
  • ip rout show
  • ip route show
ip route sh
ip route s
ip route
ip rout
ip rou
ip ro
ip r
ip r s
ip r sh
ip r sho
ip r show
ip ro show
ip rou show
ip rout show
ip route show

例如:

root@ds10:~# ip r
default via 10.82.10.12 dev ens33 onlink
10.0.0.0/8 dev ens33 proto kernel scope link src 10.10.12.25
169.254.0.0/16 dev ens33 scope link metric 1000

第一行, default via 后面的就是网关, via是:经由,通过,路过的意思

ip(8)
ip-route - routing table management
iproute2 (6.0.0-1)

Debian 10上永久配置IPv4地址,你需要修改网络接口的配置文件。以下是具体步骤: 1. 打开终端,以管理员身份登录到系统。 2. 使用编辑器(如nano或vi)打开网络接口的配置文件,例如 `eth0` 的配置文件为 `/etc/network/interfaces`。 ``` sudo nano /etc/network/interfaces ``` 3. 在文件中找到你要配置的网络接口的相关部分。通常会以 `iface <interface>` 开头,如 `iface eth0`。 4. 在接口部分添加以下行来配置IPv4地址: ``` address <IPv4_address> netmask <netmask> gateway <gateway_address> ``` 其中: - `<IPv4_address>` 是你想要配置的IPv4地址。 - `<netmask>` 是子网掩码,用于指定网络地址的范围。 - `<gateway_address>` 是默认网关的IPv4地址。 例如,要将网卡 `eth0` 的IPv4地址配置为 `192.168.0.100`,子网掩码为 `255.255.255.0`,默认网关为 `192.168.0.1`,可以添加以下行: ``` address 192.168.0.100 netmask 255.255.255.0 gateway 192.168.0.1 ``` 5. 保存并关闭文件。 6. 重启网络服务以使配置生效: ``` sudo systemctl restart networking ``` 现在你的IPv4地址应该已经永久配置成功。你可以使用以下命令来验证配置是否生效: ``` ip addr show <interface> ``` 或者使用旧的命令: ``` ifconfig <interface> ``` 请注意,上述步骤适用于Debian 10及其基于Debian的发行版。对于其他发行版,可能会有略微不同的配置文件或命令。在进行任何更改之前,请备份你的配置文件,并确保你有必要的权限和知识来进行修改。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kfepiza

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值