1、windows 添加路由条目:
route add 目标网段 mask 子网掩码 下一跳ip ;
实例:
route add 8.8.8.0 mask 255.255.255.0 192.168.8.1
这条命令的意思是: 访问目标地址是8.8.8.0/24 网段的 包都交给192.168.8.1进行转发;
2、 linux 添加 路由条目:
route add -net 目标网段 netmask 子网掩码 gw 下一条ip地址 ;
实例:
route add -net 8.8.8.0 netmask 255.255.255.0 gw 192.168.8.1
这条命令的意思是: 访问目标地址是8.8.8.0/24 网段的 包都交给192.168.8.1进行转发;
添加linux开机自启动,
将这条命令加入rc.local文件最后一行:
[root@stb stbcapture]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
route add -net 222.31.102.0 netmask 255.255.255.0 gw 192.168.10.254