當前位置:首頁 » 操作系統 » linux加路由命令

linux加路由命令

發布時間: 2022-02-10 21:46:33

linux如何配置路由

linux下添加路由的方法:
一:使用 route 命令添加
使用route 命令添加的路由,機器重啟或者網卡重啟後路由就失效了,方法:
//添加到主機的路由
# route add –host 192.168.168.110 dev eth0
# route add –host 192.168.168.119 gw 192.168.168.1
//添加到網路的路由
# route add –net IP netmask MASK eth0
# route add –net IP netmask MASK gw IP
# route add –net IP/24 eth1
//添加默認網關
# route add default gw IP
//刪除路由
# route del –host 192.168.168.110 dev eth0

二:在linux下設置永久路由的方法:
1.在/etc/rc.local里添加
方法:
route add -net 192.168.3.0/24 dev eth0
route add -net 192.168.2.0/24 gw 192.168.3.254

2.在/etc/sysconfig/network里添加到末尾
方法:GATEWAY=gw-ip 或者 GATEWAY=gw-dev

3./etc/sysconfig/static-router :
any net x.x.x.x/24 gw y.y.y.y

Ⅱ route add 添加路由的命令

你得提供你內網的網關、子網,大概的網路情況

後用route add添加路由到你電腦的路由表。

用route與用什麼軟體沒有關系,只與你的網路環境有關

Ⅲ linux怎麼添加靜態路由

linux下添加路由的方法:
一:使用 route 命令添加使用route 命令添加的路由,機器重啟或者網卡重啟後路由就失效了。

# route del –host 192.168.168.110 dev eth0
二:在linux下設置永久路由的方法:
1.在/etc/rc.local里添加方法:
route add -net 192.168.3.0/24 dev eth0
route add -net 192.168.2.0/24 gw 192.168.3.254
2.在/etc/sysconfig/network里添加到末尾
方法:GATEWAY=gw-ip 或者 GATEWAY=gw-dev
3./etc/sysconfig/static-router :
any net x.x.x.x/24 gw y.y.y.y

Ⅳ linux添加靜態路由命令

route add –host 192.168.40.3 gw 192.12.10.1

Ⅳ linux怎麼永久添加路由

舉例:
vim /etc/sysconfig/network-scripts/route-eth0
添加如下信息:
192.168.142.100/32 via 192.168.142.10
192.168.142.200/32 via 192.168.142.20
保存並退出。

Ⅵ linux路由設置命令

linux的路由設置命令主要是route:
1、添加路由命令: route add -net 192.168.0.0/24 gw 192.168.0.1 增加一個到192.168.X.X的網段,網關為192.168.0.1。
2、刪除路由命令:route del -net 192.168.0.0/24 gw 192.168.0.1
3、新增默認路由:route add default gw 192.168.0.1
4、查詢路由表 : route -n

Ⅶ linux添加靜態路由

linux下添加路由的方法:
一:使用 route 命令添加
使用route 命令添加的路由,機器重啟或者網卡重啟後路由就失效了,方法:
//添加到主機的路由
# route add –host 192.168.168.110 dev eth0
# route add –host 192.168.168.119 gw 192.168.168.1
//添加到網路的路由
# route add –net IP netmask MASK eth0
# route add –net IP netmask MASK gw IP
# route add –net IP/24 eth1
//添加默認網關
# route add default gw IP
//刪除路由
# route del –host 192.168.168.110 dev eth0

二:在linux下設置永久路由的方法:
1.在/etc/rc.local里添加
方法:
route add -net 192.168.3.0/24 dev eth0
route add -net 192.168.2.0/24 gw 192.168.3.254

2.在/etc/sysconfig/network里添加到末尾
方法:GATEWAY=gw-ip 或者 GATEWAY=gw-dev

3./etc/sysconfig/static-router :
any net x.x.x.x/24 gw y.y.y.y
滿意請採納。

熱點內容
資料庫表設計教程 發布:2025-09-16 10:50:47 瀏覽:340
朋友圈緩存如何清除 發布:2025-09-16 10:49:57 瀏覽:438
sqlserver數據類型 發布:2025-09-16 10:41:16 瀏覽:732
如何配置全站時間同步系統 發布:2025-09-16 10:19:13 瀏覽:167
java解析json文件 發布:2025-09-16 10:10:41 瀏覽:968
車配置字母怎麼看 發布:2025-09-16 10:09:32 瀏覽:408
煙台電腦伺服器維修 發布:2025-09-16 10:08:45 瀏覽:268
編譯命令cl 發布:2025-09-16 09:57:21 瀏覽:520
小君直播密碼是多少 發布:2025-09-16 09:25:46 瀏覽:610
用中文編譯的編程軟體 發布:2025-09-16 09:04:37 瀏覽:152