當前位置:首頁 » 操作系統 » 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-07-05 16:10:30 瀏覽:520
微博資料庫設計 發布:2025-07-05 15:30:55 瀏覽:20
linux485 發布:2025-07-05 14:38:28 瀏覽:301
php用的軟體 發布:2025-07-05 14:06:22 瀏覽:751
沒有許可權訪問計算機 發布:2025-07-05 13:29:11 瀏覽:428
javaweb開發教程視頻教程 發布:2025-07-05 13:24:41 瀏覽:692
康師傅控流腳本破解 發布:2025-07-05 13:17:27 瀏覽:236
java的開發流程 發布:2025-07-05 12:45:11 瀏覽:681
怎麼看內存卡配置 發布:2025-07-05 12:29:19 瀏覽:280
訪問學者英文個人簡歷 發布:2025-07-05 12:29:17 瀏覽:831