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

相关推荐
fly-3353 小时前
快速重传与快速恢复:TCP丢包的高效应对
服务器·网络·tcp/ip
stormsha6 小时前
中文路径让 MySQL 起不来:Failed to find valid data directory 与 Illegal byte sequence
运维·数据库·mysql
stormsha6 小时前
MySQL 报 `data directory has files in it`:初始化失败一次,之后就永久起不来
运维·数据库·mysql
星恒随风9 小时前
从0实现C++ AI大模型接入SDK(七):Ollama本地模型部署、NDJSON流式响应与LLMManager模型管理
linux·开发语言·c++·人工智能·笔记
zhinengws9 小时前
沃思智能智能路灯监控终端:从项目落地到智慧城市生态的深度观察
网络·人工智能·智慧城市·智能路灯监控终端
蜗牛一步步往上爬9 小时前
第十七章 创建函数
linux
沙老师11 小时前
Linux Purification Plan - More Modification
linux·运维·服务器
Tanner_SL12 小时前
Linux笔记之常用命令
linux·笔记·php
StarsGreen12 小时前
gstreamer应用使用API详解
linux
Decay__12 小时前
PostgreSQL 高可用与容灾架构 —— 流复制、Patroni、Keepalived+VIP、读写分离与两地三中心
运维·数据库·sql·postgresql