免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3889 | 回复: 9
打印 上一主题 下一主题

v440两个网卡配置不同的ip,不同的网关,请问网关在那里配置呀? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-06 23:20 |只看该作者 |倒序浏览
比如说,一个网卡ip为202.106.12.2,网关为202.106.12.1。 一个网卡ip为192.168.2.2网关为192.168.2.1\r\n\r\n第一个网卡访问外网,第二个网卡访问内网。\r\n\r\n是不是 vi /etc/defaultrouter\r\n\r\n然后把两个网关都加进去?\r\n\r\n或者不用加网关,就可以直接访问内网和外网?

论坛徽章:
0
2 [报告]
发表于 2006-01-09 08:27 |只看该作者
默认网关只能有一个.加一个/etc/gateways吧.\n\n[ 本帖最后由 风之幻想 于 2006-1-9 14:39 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2006-01-09 09:09 |只看该作者
也可以把router add net 0.0.0.0 192.168.2.1   写到/etc/rc2.d/S72inet*,具体的名字我记不清楚了

论坛徽章:
0
4 [报告]
发表于 2006-01-10 11:45 |只看该作者

能否说具体下,我现在也遇到这个问题了

原帖由 wwxipconfig 于 2006-1-9 09:09 发表\r\n也可以把router add net 0.0.0.0 192.168.2.1   写到/etc/rc2.d/S72inet*,具体的名字我记不清楚了
\r\n我现在也急需要解决这个问题

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
5 [报告]
发表于 2006-01-10 11:55 |只看该作者
原帖由 风之幻想 于 2006-1-9 08:27 发表\r\n默认网关只能有一个.加一个/etc/gateways吧.
\r\n\r\n注意:使用/etc/gateways要将/etc/defaultrouter去掉才生效\r\n楼主的问题可以参见SA-389第6章的实习例子

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
6 [报告]
发表于 2006-01-10 20:22 |只看该作者
1,如果网卡2只访问内网本网段,则很简单,网卡1写外网的地址hosts、hostname.xx0、掩码netmasks、网关defaultrouter,网卡2只写地址hostname.xx0和掩码netmasks,则有默认路由,可以满足你的要求,我在XP和SOL10下都是这样做的,一个访问外网INTERNET,一个访问内网。\r\n2,使用双网关,一个网关写defaultrouter,一个写路由在/etc/rc2.d/S72inetsvc中:\r\nrouter add net 192.168.2.0 192.168.2.1\r\n3,两个都在在/etc/gateway中:\r\nrouter add default net 202.106.12.0 202.106.12.1\r\nrouter add net 192.168.2.0 192.168.2.1

论坛徽章:
0
7 [报告]
发表于 2006-01-11 18:10 |只看该作者
添加route add脚本的情况下,可以根据情况保留/etc/defaultrouter的.

论坛徽章:
0
8 [报告]
发表于 2006-01-12 09:07 |只看该作者
同意FLUTTER的2,觉得这种应用较多

论坛徽章:
0
9 [报告]
发表于 2006-02-08 14:35 |只看该作者
多谢几位大侠拔刀相助

论坛徽章:
0
10 [报告]
发表于 2006-02-08 15:02 |只看该作者
Multihomed Host\r\nTo create a multihomed host:\r\n1. Become superuser on the prospective multihomed host.\r\n2. Create an /etc/hostname.interface file for each additional\r\nnetwork interface installed in the machine.\r\n3. Type:\r\n# touch /etc/notrouter\r\nThis creates an empty file called /etc/notrouter.\r\n4. Reboot the machine.\r\nWhen the machine reboots, the startup script looks for the presence of\r\nthe /etc/notrouter file. If the file exists, the startup script does not\r\nrun in.routed -s or in.rdisc -r, and does not turn on IP\r\nforwarding on all interfaces configured “up” by ifconfig. This\r\nhappens regardless of whether an /etc/gateways file exists. Thus the\r\nmachine is now a multihomed host.\r\n===================================\r\n详细内容可以看SA389-SG的第六章
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP