當前位置:首頁 » 操作系統 » 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
滿意請採納。

熱點內容
qq電腦聊天緩存不安全 發布:2025-09-19 03:43:38 瀏覽:361
大話2腳本製作 發布:2025-09-19 03:25:47 瀏覽:497
腳本精靈用的什麼語言 發布:2025-09-19 03:21:32 瀏覽:847
微型機常用的存儲器 發布:2025-09-19 03:18:17 瀏覽:469
迷你世界腳本編輯代碼在哪裡 發布:2025-09-19 03:17:40 瀏覽:374
我的世界110伺服器的天域組織 發布:2025-09-19 02:49:36 瀏覽:797
為什麼安卓手機使用久了會變卡 發布:2025-09-19 02:49:36 瀏覽:876
國家校時伺服器ip 發布:2025-09-19 02:45:18 瀏覽:922
安卓補幀軟體在哪裡下 發布:2025-09-19 02:45:17 瀏覽:33
安卓移機蘋果怎麼操作 發布:2025-09-19 01:58:55 瀏覽:164