linux route没有默认路由解决

1.route看不到default路由,只有到本网段的的

root@datasrv network-scripts\]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.81.0 0.0.0.0 255.255.255.0 U 100 0 0 p6p1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

2.添加默认路由

root@datasrv network-scripts\]# ip route add default via 192.168.81.1

3.查看添加的默认路由

root@datasrv network-scripts\]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default gateway 0.0.0.0 UG 0 0 0 p6p1 192.168.81.0 0.0.0.0 255.255.255.0 U 100 0 0 p6p1 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

相关推荐
深紫色的三北六号7 小时前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash11 小时前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI21 小时前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行2 天前
Linux和window共享文件夹
linux
木心月转码ing2 天前
WSL+Cpp开发环境配置
linux
蝎子莱莱爱打怪3 天前
Centos7中一键安装K8s集群以及Rancher安装记录
运维·后端·kubernetes
崔小汤呀3 天前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应3 天前
vi编辑器使用
linux·后端·操作系统
何中应3 天前
Linux进程无法被kill
linux·后端·操作系统
何中应3 天前
rm-rf /命令操作介绍
linux·后端·操作系统