转自:https://www.jianshu.com/p/bc27134bde3d

Juniper srx新增接口IP,使PC直连srx

2018.11.19 14:24:15字数 424

概述

需求为PC直连srx防火墙,配置互联IP,并允许PC访问untrust区域,能够访问互联网
本例中防火墙新增地址 10.1.1.1/30
PC配置IP:10.1.1.2/30 gateway:10.1.1.1

说明

用户视图:root@srx>
配置视图:root@srx#
配置视图:root@srx# run show config run 表示在用户视图下执行命令
root@srx# show #查看当前的配置,注意这里是已配置上的,但不一定生效
root@srx# run show config #查看当前已生效的配置
root@srx> show config #查看当前已生效的配置

配置步骤

  1. 检查现有的端口IP
    root@srx> show interfaces terse
    找一个不冲突的IP
  2. 查看路由表
    找到IP后,再查看路由表是否有去到这个网段的路由,没有则为正常,如果有就不应使用这个地址
    root@srx> show route
  3. 配置接口IP和区域
    set interfaces ge-0/0/2 unit 0 family inet address 10.1.1.1/30
    set security zones security-zone trust interfaces ge-0/0/2 #为方便配置,将该接口添加进已有的区域,本例为trust区域
  4. 验证是否配置源NAT
root@srx# run show security nat source summary  #查看现有的源NAT策略
Total port number usage for port translation pool: 0
Maximum port number for port translation pool: 67108864
Total pools: 0 Total rules: 7
Rule name Rule set From To Action
1 trust-to-untrust trust untrust interface
root@srx# run show security nat source rule 1 

source NAT rule: 1                    Rule-set: trust-to-untrust
Rule-Id : 1
Rule position : 1
From zone : trust
To zone : untrust
Match
Source addresses : 0.0.0.0 - 255.255.255.255 #源地址已匹配any
Destination addresses : 0.0.0.0 - 255.255.255.255
Destination port : 0 - 0
Action : interface
Persistent NAT type : N/A
Persistent NAT mapping type : address-port-mapping
Inactivity timeout : 0
Max session number : 0
Translation hits : 111
  1. 验证安全策略是否放行trust->untrust
root@srx# run show security policies from-zone trust to-zone untrust
From zone: trust, To zone: untrust
Policy: ABC, State: enabled, Index: 18, Scope Policy: 0, Sequence number: 1
Source addresses: OFFICE_Set #仅放行了OFFICE_Set 这个address book的地址段
Destination addresses: any
Applications: any
Action: permit
Policy: 1, State: enabled, Index: 6, Scope Policy: 0, Sequence number: 2
Source addresses: any
Destination addresses: any
Applications: any
Action: deny

需要新增address-book
root@srx# set security zones security-zone trust address-book address test_add 10.1.1.2
新增策略

set security policies from-zone trust to-zone untrust policy 2 match source-address test_add
set security policies from-zone trust to-zone untrust policy 2 match destination-address any
set security policies from-zone trust to-zone untrust policy 2 match application any
set security policies from-zone trust to-zone untrust policy 2 then permit

查看策略的配置顺序

root@srx# show security policies from-zone trust to-zone untrust | display set
set security policies from-zone trust to-zone untrust policy 1 match source-address any
set security policies from-zone trust to-zone untrust policy 1 match destination-address any
set security policies from-zone trust to-zone untrust policy 1 match application any
set security policies from-zone trust to-zone untrust policy 1 then deny
set security policies from-zone trust to-zone untrust policy 2 match source-address test_add
set security policies from-zone trust to-zone untrust policy 2 match destination-address any
set security policies from-zone trust to-zone untrust policy 2 match application any
set security policies from-zone trust to-zone untrust policy 2 then permit

如上所示,可以看到新增的policy2在下边,这样会先匹配到policy 1,被deny掉
所以需要改变策略的顺序,用如下命令
insert security policies from-zone trust to-zone untrust policy 2 before policy 1

    1. 提交配置
      root@srx# commit

Juniper srx新增接口IP,使PC直连srx(转)的更多相关文章

  1. 微信公众平台宣布增加接口IP白名单提高安全性

    微信公众平台目前已经发布通知在平台接口调用上为了提高安全性需要添加IP白名单并仅允许白名单IP调用. 目前微信公众平台面向开发者主要提供的开发者ID和开发者密钥,在调用时ID和密钥通过检验即可进行调用 ...

  2. Zynq-PL中创建AXI Master接口IP及AXI4-Lite总线主从读写时序测试(转)

    转载:原文  http://www.eefocus.com/antaur/blog/17-08/423751_6cc0d.html 0. 引言 通过之前的学习,可以在PL端创建从机模式的AXI接口IP ...

  3. android与PC直连的socket问题

    关键字:abdroid 模拟器 socket 突然有人说使用android的模拟器做socket服务器,PC做客户端,使用UDP通信的时候,android端无法收到数据包.反过来没问题,我觉得这怎么可 ...

  4. 七、环回接口ip地址(逻辑接口)

    loopback接口,在网络设备(一般是路由器)上是一种特殊的接口,它不是物理接口,而是一种看不见摸不着的逻辑接口(也称虚拟接口),但是对于网络设备来说却是至关重要的. 在网络设备上可以通过配置命令来 ...

  5. [转帖]CS、IP和PC寄存器

    https://www.cnblogs.com/zhuge2018/p/8466288.html 之前的理解不对 当然了 现在的理解也不太对.. CS.IP和PC寄存器 CS寄存器和IP寄存器: 首先 ...

  6. 两个不同网段的PC直连是否可以Ping通,肯定可以Ping的通(转)

    在这一篇文章中http://blog.csdn.net/zhangdaisylove/article/details/46892917的案例,明确的说明两个不同网段的PC不能Ping的通,其实他给出的 ...

  7. juniper防护墙接口的NAT和ROUTE模式如何选择问题

    juniper防护墙一般是把trust接口部署为NAT模式,untrust接口部署为route模式.这样当来自内部的数据访问Utrust区域时,会把源地址翻译成untrust接口的地址.从而达到隐藏内 ...

  8. Android 手机应用开发经验 之 通过Socket(TCP/IP)与PC通讯

    Android 是一个开源的手机操作系统平台,已经被非常多的开发者视作未来最有潜力的智能手机操作系统.而且,在很短的时间内就在Android Market上出现大量的第三方应用程序,供用户下载与使用, ...

  9. 自定义AXI总线形式SPI接口IP核,点亮OLED

    一.前言 最近花费很多精力在算法仿真和实现上,外设接口的调试略有生疏.本文以FPGA控制OLED中的SPI接口为例,重新夯实下基础.重点内容为SPI时序的RTL设计以及AXI-Lite总线分析.当然做 ...

随机推荐

  1. 虚拟 DOM 到底是什么?

    虚拟 DOM 到底是什么? 作者:wangshengliang 注意:由于文章太长,对文章有删减,但是不会影响整体阅读 是什么? 虚拟 DOM (Virtual DOM )这个概念相信大家都不陌生,从 ...

  2. Biu一Biu--GDB

    gcc常见编译选项 ** -c **:只激活预处理.编译和汇编,也就是生成obj文件 ** -S **:只激活处理和编译,把文件编译成汇编代码 ** -o **:定制目标名称,缺省的时候编译出来的可执 ...

  3. .NET 一次读取几百条数据优化,从原来30分钟优化到30秒

    1.全部数据读取到内存, 不要使用string,而是使用stringbuilder,stringbuilder的效率非常高 2.添加到数据库 不要使用excute,而是使用事务,几百万条数据会请求数据 ...

  4. HDU_4965 Fast Matrix Calculation 2014多校9 矩阵快速幂+机智的矩阵结合律

    一开始看这个题目以为是个裸的矩阵快速幂的题目, 后来发现会超时,超就超在  M = C^(N*N). 这个操作,而C本身是个N*N的矩阵,N最大为1000. 但是这里有个巧妙的地方就是 C的来源其实 ...

  5. MBE风格图标

    图标的定义 图标是一种通过相似性或类比行来代表对象的符号. 图标的重要性 1.图形以其无与伦比的识别性带来信息传达效率的提升. 2.图形以其百变多样的趣味性带来视觉体验的享受提成用户体验. 3.图形以 ...

  6. POJ 1573:Robot Motion

    Robot Motion Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11324   Accepted: 5512 Des ...

  7. 第42章 AWR报表的使用

    第42章 AWR报表的使用exec dbms_gather.gather_table_stats('scott','emp');exec dbms_gather_gather_index_stats( ...

  8. 吴裕雄--天生自然 PHP开发学习:常量

    <?php // 区分大小写的常量名 define("GREETING", "欢迎访问 Runoob.com"); echo GREETING; // 输 ...

  9. 使用H5搭建webapp主页面

    使用H5搭建webapp主页面 前言: 在一个h5和微信小程序火热的时代,作为安卓程序员也得涉略一下h5了,不然就要落后了,据说在简历上可以加分哦,如果没有html和css和js基础的朋友,可以自行先 ...

  10. python数据拼接: pd.concat

    1.concat concat函数是在pandas底下的方法,可以将数据根据不同的轴作简单的融合 pd.concat(objs, axis=0, join='outer', join_axes=Non ...