码迷,mamicode.com
首页 > Web开发 > 详细

Juniper NetScreen 基于源NAT转换

时间:2015-02-02 16:12:24      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:policy


1.NAT-Src with PAT Enabled

从trust到untrust转换

转换前:(Source IP:10.1.1.1 Source port: 3899)

转换后:(Source IP: 202.100.100.100 Source port: 4000)

对trust的IP以及port都做转换

****************************************************

CLI:

set int eth1 zone trust

set int eth1 ip 10.1.1.1/24

set int eth1 nat

set int eth3 zone untrust

set int eth3 ip 1.1.1.1/24

set int eth3 route

set int eth3 dip 5 1.1.1.30 1.1.1.30

set policy from trust to untrust any any any nat src dip-id 5 permit log

*****************************************************

2.NAT-Src with PAT Disabled

从trust到untrust转换

转换前:(Source IP:10.1.1.1 Source port: 3899)

转换后:(Source IP: 202.100.100.100 Source port: 3899)

对trust的IP做转换,但不对trust的port做转换

***********************************************************

CLI:

set int eth1 zone trust

set int eth1 ip 10.1.1.1/24

set int eth1 nat

set int eth3 zone untrust

set int eth3 ip 1.1.1.1/24

set int eth3 route

set int eth3 dip 6 1.1.1.50 1.1.1.150 fix-port

set policy from trust to untrust any any any nat src dip-ip 6 permit log

*******************************************************

3.NAT-Src with Address Shifting


*******************************************************

CLI:

set int eth1 zone trust

set int eth1 ip 10.1.1.1/24

set int eth1 nat

set int eth3 zone untrust

set int eth3 ip 1.1.1.1/24

set int eth3 ip route

set int eth3 dip 10 shift-from 10.1.1.11 to 1.1.1.101 1.1.1.105

set address trust host1 10.1.1.11/32

set address trust host2 10.1.1.12/32

set address trust host3 10.1.1.13/32

set address trust host4 10.1.1.14/32

set address trust host5 10.1.1.15/32

set group address trust group1 add host1

set group address trust group1 add host2

set group address trust group1 add host3

set group address trust group1 add host4

set group address trust group1 add host5

set policy from trust to untrust group1 any any nat src dip-id 10 permit log


3.NAT-Src Without DIP

从trust到untrust转换

转换前:(Source IP:10.1.1.1 Source port: 3899)

转换后:(Source IP: 202.100.100.100 Source port: 4000)

对trust的IP以及port都做转换

******************************************************

CLI :

set int eth1 zone trust

set int eth1 ip 10.1.1.1/24

set int eth1 nat

set int eth3 zone untrust

set int eth3 ip 1.1.1.1/24

set int eth3 route

set policy from trust to untrust any any any nat src  permit log

或者

set int eth1 zone trust

set int eth1 ip 10.1.1.1/24

set int eth1 nat

set int eth3 zone untrust

set int eth3 ip 1.1.1.1/24

set int eth3 route

set policy from trust to untrust any any any permit log


本文出自 “CHJ农民工” 博客,请务必保留此出处http://3155099.blog.51cto.com/3145099/1610629

Juniper NetScreen 基于源NAT转换

标签:policy

原文地址:http://3155099.blog.51cto.com/3145099/1610629

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!