Chinaunix首页 | 论坛 | 博客
  • 博客访问: 53754
  • 博文数量: 13
  • 博客积分: 1420
  • 博客等级: 上尉
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-06 17:05
文章分类
文章存档

2011年(1)

2009年(12)

最近访客

分类: 系统运维

2009-03-08 16:39:35

               PIX 的透明防火墙配置
R1/R2/R3设置IP地址,并设置一条默认路由,指向自己的下一跳。
SW开启所使用端口,划分VLAN,将F0/15端口设置为trunk端口。
进入防火墙全局模式
show flash:      //查看防火墙Flash中配置文件,如果存在*.cfg  可以使用命令del flash:/*.cfg命令将其删除。
show mode    //查看当前防火墙模式,如果是single单模式,需要使用命令mode  multiple将防火墙设置为多模式。
首先创建管理context
全局:
admin-context admin     //设置管理context的名称为admin
context admin               //生成admin这个context
config-url flash:/admin.cfg           //设置admin-context的配置文件存放位置和名称
exit
changeto context admin     //从当前系统配置模式切换到admin context模式
write                                 //写入配置,将会生成admin.cfg文件
changeto system               //返回系统配置模式
进入防火墙的e1 e0.1 e0.2接口,将其激活并配置VLAN(绝对不能配置nameif)
int e0.1
vlan 2
int e0.2
vlan 4                 //子接口必须指定到VLAN,默认封装dot.1q协议
(如果不在系统模式将子接口指定到VLAN,之后在context模式中,将无法对接口进行nameif)
context c1        //创建第一个context,命名为C1
config-url flash:/c1.cfg          //设置c1 context的配置文件位置及名称。
allocate-interface e1            //将e1接口分配给context c1
allocate-interface e0.1         //将e0.1子接口分配给context c1
context c2       //创建第二个context,命名为C2
config-url flash:/c2.cfg         //设置c2 context的配置文件位置及名称。
allocate-interface e1            //将e1接口分配给context c2
allocate-interface e0.2         //将e0.2子接口分配给context c2
changeto context c1
write                //写入配置,保存到c1.cfg文件
changeto context c2
write
changeto system
changeto context c1     //进入C1 context
int e1
nameif outside
ip add 3.1.1.1 255.255.255.0
no sh
int e0.1
nameif inside
ip add 1.1.1.254 255.255.255.0
no sh
access-list out permit icmp any any        //设置这条acl允许icmp流量放行,方便之后使用ping测试。
access-group out in inter outside            //将out这条acl应用到outside的in方向
changeto context c2
int e1
nameif outside
ip add 3.1.1.2 255.255.255.0
no sh
int e0.2
nameif inside
ip add 2.1.1.254 255.255.255.0
no sh
access-list out permit icmp any any
access-group out in inter outside
到此为止虚拟防火墙已经配置完毕,但是R1还无法ping通R3
因为当前E1只有一个MAC地址,2层数据帧在到达防火墙E1口时,将不知道如何将数据帧发给谁,所以必须给context 1和context 2分别分配不同的MAC地址
changeto context c1
int e1
mac-address 0001.0001.0001
exit
changeto context c2
int e1
mac-address 0002.0002.0002
exit
 
阅读(1058) | 评论(0) | 转发(0) |
0

上一篇:vlan间的路由

下一篇:REDHAT搭建DHCP

给主人留下些什么吧!~~