找回密码
 注册
查看: 1231|回复: 0

ubuntu系统添加路由

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-2-28 14:06:13 | 显示全部楼层 |阅读模式
root@controller:~# ip route add 192.168.2.0/24 via 0.0.0.0 dev ens33 3 T1 d3 G9 I4 Q8 K2 ?. x% j
root@controller:~# route -n
7 S" v: c2 F  O, t& J$ kKernel IP routing table
3 Q1 x- S8 a7 Y* `7 X9 sDestination     Gateway         Genmask         Flags Metric Ref    Use Iface
  `2 e( f) f+ n+ H0.0.0.0         192.168.13.2    0.0.0.0         UG    0      0        0 ens36/ Z8 L# I* G  C+ U. h1 J% P
162.96.90.0     0.0.0.0         255.255.255.0   U     0      0        0 ens34: t# m1 g/ T3 c0 d* p- A
171.10.91.0     0.0.0.0         255.255.255.0   U     0      0        0 ens35
( u/ z1 Q5 k* u& t192.168.0.0     0.0.0.0         255.255.252.0   U     0      0        0 ens33( G7 G+ ~9 D* ]# G
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33" W/ @3 c5 X3 Y  L# p& s
192.168.13.0    0.0.0.0         255.255.255.0   U     0      0        0 ens36
5 E" ~+ K/ H% N% m% l
% n3 p" Q" F1 E3 h
9 E5 t" r% N. K8 L/ b5 K, ]. J; Proot@controller:~# ip route add 0.0.0.0 via 192.168.2.254 dev ens33
* f/ }, O3 D  z) O' B
1 H4 p- r3 {7 W9 c4 `1 B# ~0 Kroot@controller:~# route -n0 q  q5 r6 {: T9 t
Kernel IP routing table& {; H/ |: H1 d4 l0 D$ j
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
9 m2 U9 p" t! e* e0.0.0.0         192.168.2.254   255.255.255.255 UGH   0      0        0 ens33- I8 i4 q; u& J0 j& O% A( G3 @
0.0.0.0         192.168.13.2    0.0.0.0         UG    0      0        0 ens36# P) l( I8 g2 }6 z' l7 i9 |  |
162.96.90.0     0.0.0.0         255.255.255.0   U     0      0        0 ens343 q5 V/ n3 {  O- |5 j. n2 E
171.10.91.0     0.0.0.0         255.255.255.0   U     0      0        0 ens35
3 z: B6 e/ L$ a' f! ^+ I192.168.0.0     0.0.0.0         255.255.252.0   U     0      0        0 ens33- s$ L- O' }/ x
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
" c$ @) [( @5 K2 D192.168.13.0    0.0.0.0         255.255.255.0   U     0      0        0 ens36' y) p: ]1 Y% w
# l: D& m2 o  V& u3 i
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 03:05 , Processed in 0.054325 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表