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

相关推荐
NGINX开源社区1 小时前
F5 NGINX Ingress Controller 5.3.0 新增功能
运维
醉熏的石头1 小时前
Ubuntu 中的编程语言(中)
linux·ubuntu·scala
SelectDB2 小时前
Apache Doris 在 AgentLogsBench 中领先,支撑 Agent 可观测性生产负载
运维·数据库·agent
荣-3 小时前
从两天到十几分钟:一套 YT Crash 自动化分析工具完整工程复盘
大数据·运维·自动化
酷炫的水壶3 小时前
使用memc-nginx和srcache-nginx模块构建高效透明的缓存机制
运维·nginx·缓存
dddwjzx4 小时前
嵌入式Linux C应用编程入门——信号
linux·嵌入式
fei_sun4 小时前
开放最短路径优先OSPF----基于链路状态
网络
精明的身影4 小时前
网络计划WebApp求解:融合Python与AI决策的项目管理系统
网络·python·web app
范什么特西5 小时前
网络代理问题
java·linux·服务器
姚不倒5 小时前
F5 SSL Profile 证书卸载深入篇
运维·网络协议·负载均衡·ssl·f5