同一台服务器配置2个路由网关,内外和外网

[root@CM-SH-81 ~]# more /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
/usr/sbin/opt-cache
/usr/sbin/agent
ip rule add pref 10 from 10.10.24.81 table 10
ip rule add pref 20 from 221.130.176.4 table 20
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.81 table 10
ip route add 10.10.24.0/24 dev eth0 src 10.10.24.81 table 10
ip route replace default via 10.10.24.65 table 10
ip route add 221.130.176.0/24 dev eth1 src 221.130.176.4 table 20
ip route replace default via 221.130.176.1 table 20
ip route replace default via 221.130.176.1
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.81
ip route flush cache

[root@CM-SH-82 ~]# more /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
/usr/sbin/opt-cache

/app/rrd/rrd-center.pl
/usr/sbin/agent
ip rule add pref 10 from 10.10.24.82 table 10
ip rule add pref 20 from 221.130.176.4 table 20
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.82 table 10
ip route add 10.10.24.0/24 dev eth0 src 10.10.24.82 table 10
ip route replace default via 10.10.24.65 table 10
ip route add 221.130.176.0/24 dev eth1 src 221.130.176.4 table 20
ip route replace default via 221.130.176.1 table 20
ip route replace default via 221.130.176.1
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.82
ip route flush cache

[root@CM-SH-85 ~]# more /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
mount /dev/sdb1 /backup
/usr/sbin/opt-cache
/usr/sbin/agent

ip rule add pref 10 from 10.10.24.85 table 10
ip rule add pref 20 from 221.130.176.6 table 20
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.85 table 10
ip route add 10.10.24.0/24 dev eth0 src 10.10.24.85 table 10
ip route replace default via 10.10.24.65 table 10
ip route add 221.130.176.0/24 dev eth1 src 221.130.176.6 table 20
ip route replace default via 221.130.176.1 table 20
ip route replace default via 221.130.176.1
ip route add 40.40.40.0/24 dev eth0 src 10.10.24.85
ip route flush cache

相关文档
最新文档