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

相关推荐
用户03284722207014 小时前
如何搭建本地yum源(上)
运维
A小辣椒2 天前
TShark:Wireshark CLI 功能
linux
A小辣椒2 天前
TShark:基础知识
linux
AlfredZhao2 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao3 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334663 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux
猪脚踏浪3 天前
linux 拷贝文件或目录到指定的位置
linux
大树884 天前
金刚石散热越强,管路越先见顶
大数据·运维·服务器·人工智能·ai
摇滚侠4 天前
Linux CentOS7 rpm 安装 MySQL 5.7
linux·运维·mysql
霸道流氓气质4 天前
领域驱动设计(DDD)在 Spring Boot 微服务中的实践指南
运维·spring boot·微服务