Chinaunix首页 | 论坛 | 博客
  • 博客访问: 804603
  • 博文数量: 244
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 2420
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-29 09:07
文章分类

全部博文(244)

文章存档

2011年(4)

2010年(3)

2009年(72)

2008年(119)

2007年(46)

我的朋友

分类: LINUX

2008-04-29 01:21:45

Ubuntu下双网卡配置路由,实现两个网段互联
一个网段A:10.4.1.*/16,而公司原有域为B:10.2.1.*/16,为了使两个网段能够通信,本文的目的就在Ubuntu下设置路由,
使两个网段可以互相通信。
1、ubuntu机器配置为双网卡,分别连接两个网段。
sudo vi interfaces

dd
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.2.1.216
        netmask 255.255.0.0
        network 10.2.0.0
        broadcast 10.2.255.255
        gateway 10.2.1.218
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 211.93.80.129 211.94.65.97 211.98.4.1
auto eth1
iface eth1 inet static
        address 10.4.1.216
        netmask 255.255.0.0
        network 10.4.0.0
        broadcast 10.4.255.255
        gateway 10.4.1.10
        dns-nameservers 211.93.80.129 211.94.65.97

iface dsl-provider inet ppp
provider dsl-provider
2、打开包转发
编辑/etc/sysctl.conf

net.ipv4.ip_forward = 0
改成
net.ipv4.ip_forward = 1

阅读(2254) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~