注意:使用/etc/gateways要将/etc/defaultrouter去掉才生效
楼主的问题可以参见SA-389第6章的实习例子作者: flutter 时间: 2006-01-10 20:22
1,如果网卡2只访问内网本网段,则很简单,网卡1写外网的地址hosts、hostname.xx0、掩码netmasks、网关defaultrouter,网卡2只写地址hostname.xx0和掩码netmasks,则有默认路由,可以满足你的要求,我在XP和SOL10下都是这样做的,一个访问外网INTERNET,一个访问内网。
2,使用双网关,一个网关写defaultrouter,一个写路由在/etc/rc2.d/S72inetsvc中:
router add net 192.168.2.0 192.168.2.1
3,两个都在在/etc/gateway中:
router add default net 202.106.12.0 202.106.12.1
router add net 192.168.2.0 192.168.2.1作者: 风之幻想 时间: 2006-01-11 18:10
添加route add脚本的情况下,可以根据情况保留/etc/defaultrouter的.作者: wxws2002 时间: 2006-01-12 09:07
同意FLUTTER的2,觉得这种应用较多作者: zcg931708 时间: 2006-02-08 14:35
多谢几位大侠拔刀相助作者: metor78 时间: 2006-02-08 15:02
Multihomed Host
To create a multihomed host:
1. Become superuser on the prospective multihomed host.
2. Create an /etc/hostname.interface file for each additional
network interface installed in the machine.
3. Type:
# touch /etc/notrouter
This creates an empty file called /etc/notrouter.
4. Reboot the machine.
When the machine reboots, the startup script looks for the presence of
the /etc/notrouter file. If the file exists, the startup script does not
run in.routed -s or in.rdisc -r, and does not turn on IP
forwarding on all interfaces configured “up” by ifconfig. This
happens regardless of whether an /etc/gateways file exists. Thus the
machine is now a multihomed host.
===================================
详细内容可以看SA389-SG的第六章