要在Linux中添加永久静态路由,可以使用以下命令:使用route add命令添加永久静态路由:route add -p permanent <network> <destination>其中,<network>是要添加路由的子网或网段的网络地址,<destination>是该路由的目标地址。例如,如果要将网段192.168.1.0/24上的路由192.168.1.1/32保存到永久静态路由中,可以...
1. 把路由规则添加到/etc/rc.locla文件,例如: /sbin/route add –net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 dev eth0 /sbin/route add –net 192.168.3.0/24 gw 192.168.3.254 dev eth0 2. 在/etc/sysconfig/network-scripts目录下面创建路由文件 cd /etc/sysconfig/network-scripts vi route-...
-p 与 add 命令一起使用时,该命令将永久生效 (permanent) add:添加一条新路由 del:删除一条路由 -net:目标地址是一个网络 -host:目标地址是一个主机 netmask:当添加一个网络路由器时,需要使用网络掩码 gw:路由数据包通过网关。注意,你指定的网关必须能够达到 metric:设置路由跳数 Command:指定您想运行的命令(...
# 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 //删除路由 ...
# 2011.07.15 add permanent route test route add -net 10.0.0.0 netmask 255.0.0.0 reject [root@node34 root]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.227.0 * 255.255.255.0 U 0 0 0 eth0 ...
# route [add|del] [-net|-host] target [netmask Nm] [gw Gw] [[dev] If] 其中: add : 添加一条路由规则 del : 删除一条路由规则 -net : 目的地址是一个网络 -host : 目的地址是一个主机 target : 目的网络或主机 netmask : 目的地址的网络掩码 ...
命令add、change、replace、delete、fulsh、show(或者list) 6.1 ip neighbour add -- 添加一个新的邻接条目 ip neighbour change--修改一个现有的条目 ip neighbour replace--替换一个已有的条目 缩写:add、a;change、chg;replace、repl 示例1: 在设备eth0上,为地址10.0.0.3添加一个permanent ARP条目: ...
Route, add, 10.41.0.0, mask, 255.255.0.0, 10.27.0.1 Example 5: to add the target to 10.41.0.0, the subnet mask to 255.255.0.0, the next hop address to 10.27.0.1 is the permanent route, and execute the following command: Route, -p, add, 10.41.0.0, mask, 255.255.0.0, 10.27....
Route命令是用于操作基于内核ip路由表,它的主要作用是创建一个静态路由让指定一个主机或者一个网络通过一个网络接口,如eth0。当使用"add"或者"del"参数时,路由表被修改,如果没有参数,则显示路由表当前的内容。 3.命令参数: -c 显示更多信息 -n 不解析名字 ...
route add -p 192.168.1.0 mask 255.255.255.0 10.0.0.1 if 1 When specifying the network interface, you have to provide the interface ID which you can find using the route print command. Windows hold permanent static routes in the following registry ...