找回密码
 注册
查看: 1228|回复: 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
  k/ A9 N( F9 ~8 R, @& D, ?root@controller:~# route -n3 t* k' |. y( ?) a$ \
Kernel IP routing table! B6 T/ K" S) A8 S! L1 q- }
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
7 x$ \! b8 q# W: r. Q0.0.0.0         192.168.13.2    0.0.0.0         UG    0      0        0 ens36
6 ~9 f* t, o* a0 ?4 J162.96.90.0     0.0.0.0         255.255.255.0   U     0      0        0 ens34
# U  V" }' N' T0 G! a, M171.10.91.0     0.0.0.0         255.255.255.0   U     0      0        0 ens355 \4 h! v% ?9 V/ d! [
192.168.0.0     0.0.0.0         255.255.252.0   U     0      0        0 ens33
0 \, z; @$ l8 d: f, M. [192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
) ~% F2 Z% X9 }! T9 A' m+ |: R192.168.13.0    0.0.0.0         255.255.255.0   U     0      0        0 ens36
+ w% t8 z& T# D3 K- d( Q" a, }6 q
: C$ [& f: u# C8 a" e; u3 u& R' k- z' F+ Q1 b. k: \% H
root@controller:~# ip route add 0.0.0.0 via 192.168.2.254 dev ens33
, C6 A- c% r6 F; e" t
/ K' m# s, O6 {4 x  l- d, p  Kroot@controller:~# route -n
" G# V, n+ [+ N3 ^( F6 K" N5 BKernel IP routing table) D) g3 Q1 |' m% b
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface0 Z/ D/ G0 d+ U6 c  F; ?; v
0.0.0.0         192.168.2.254   255.255.255.255 UGH   0      0        0 ens33
8 ]7 N! p0 S0 _6 r& w0.0.0.0         192.168.13.2    0.0.0.0         UG    0      0        0 ens36- o: d7 d: i% ^) v  y; s
162.96.90.0     0.0.0.0         255.255.255.0   U     0      0        0 ens34
3 _$ U# P. ~4 b" l! ^7 p: l1 P171.10.91.0     0.0.0.0         255.255.255.0   U     0      0        0 ens35
) L  [4 O2 T: V$ d* H* a9 c  H192.168.0.0     0.0.0.0         255.255.252.0   U     0      0        0 ens330 b. h+ @" b3 N+ E7 @4 X+ E
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 ens33
4 y- F7 ^5 G* g+ E192.168.13.0    0.0.0.0         255.255.255.0   U     0      0        0 ens366 ?' W" D9 j2 K( P! @

9 E( q2 b. x! H# A. f
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 01:49 , Processed in 0.015947 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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