免费注册 查看新帖 |

Chinaunix

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

[网络管理] 锐捷双网卡共享上网 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-15 07:59 |只看该作者 |倒序浏览
本帖最后由 crzyfish 于 2010-03-15 21:47 编辑

系統:UBUNTU SERVER


如果你有配置DHCP3的话,/etc/rc.local内容应该是:
  1. sleep 10    //故意延迟是为了让mentohust能正常启动,不然会和dhcpserver冲突
  2. mentohust -b3 -y5 -w  //以daemon形式并记录log

  3. iptables -F      //iptable设置
  4. iptables -P INPUT ACCEPT
  5. iptables -P FORWARD ACCEPT
  6. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

  7. sleep 6    //延迟是为了eth1能正常设置IP,不然会和mentohust冲突
  8. eth1
复制代码
上面所写的eth1脚本代码为:
  1. #!/bin/sh
  2. ifconfig eth1 192.168.0.1 netmask 255.255.255.0
复制代码
在/etc/sysctl.conf去掉
net.ipv4.ip_fprward=1    前面的#

一下dhcp3-server设置供参考:
apt-get install dhcp3-server

vi /etc/default/dhcp3-server
改成
INTERFACES="eth1"


vi /etc/dhcp3/dhcpd.conf

# A slightly different configuration for an internal subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.2 192.168.0.10;
  option domain-name-servers www.xxxx.com;
  option domain-name "xxxx.com";
  option routers 192.168.0.1;
  option broadcast-address 192.168.0.255;
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP