设为首页 收藏本站
查看: 962|回复: 0

[经验分享] juniper srx 基础配置--命令行

[复制链接]

尚未签到

发表于 2018-7-27 12:27:56 | 显示全部楼层 |阅读模式
  set interface
  set routing-options static
  更改初始密码
  set system root-authentication plain-text-password 回车
  New password:
  retype new password:

  set system login user admin>  set system login user admin authentication plain-text-password 输入密码
  set system services ssh
  set security zones security-zone untrust host-inbound-traffic system-services ssh/ping
  set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ssh /telnet/ping
  set security zones security-zone trust host-inbound-traffic system-services ssh /telnet /ping
  set security zones security-zone trust interfaces ge-0/0/1.0 host-inbound-traffic system-services ssh /telnet/ping
  set security zones security-zone untrust interfaces ge-0/0/0 (不定义区域,无法配置NAT)
  set security zones security-zone trust interfaces ge-0/0/1
  ###### set security zones security-zone trust interfaces ge-0/0/1 ???
  ###### set interfaces interface-range interfaces-trust member ge-0/0/1  ????
  静态NAT:
  set security nat source rule-set interface-nat from zone trust
  set security nat source rule-set interface-nat to zone untrust
  set security nat source rule-set interface-nat rule rule1 match source-address 192.168.0.0/23
  set security nat source rule-set interface-nat rule rule1 match destination-address 0.0.0.0/0
  set security nat source rule-set interface-nat rule rule1 then source-nat interface
  set security zones security-zone trust address-book address 192 192.168.0.0/23
  set security zones security-zone trust address-book address-set 192nat address 192
  set security policies from-zone trust to-zone untrust policy 192nat match source-address any
  set security policies from-zone trust to-zone untrust policy 192nat match destination-address any
  set security policies from-zone trust to-zone untrust policy 192nat match application any
  set security policies from-zone trust to-zone untrust policy 192nat then permit
  强制172.16.0.12走150出去(默认走物理接口146出去)
  set security nat source pool pool-1 address 121.9.255.112
  set security nat source rule-set sou-nat rule rule-mail match source-address 172.16.0.12/32
  set security nat source rule-set sou-nat rule rule-mail match destination-address 0.0.0.0/0
  set security nat source rule-set sou-nat rule rule-mail then source-nat pool pool-1
  insert security nat source rule-set sou-nat rule rule-mail before rule rule-sou
  ##########################################################
  端口映射 静态PAT: 从外到内
  set security nat proxy-arp interface ge-0/0/0.0 address 10.1.1.100/24
  set security nat proxy-arp interface ge-0/0/3.0 address 10.1.2.100/24
  set security nat destination pool dnat-pool-1 address 192.168.0.9/32
  set security nat destination pool dnat-pool-2 address 172.16.0.12/32
  set security nat destination rule-set dst-nat from zone untrust
  set security nat destination rule-set dst-nat rule rule3 match destination-address 10.1.1.100/24
  set security nat destination rule-set dst-nat rule rule3 match destination-port 21
  set security nat destination rule-set dst-nat rule rule3 then destination-nat pool dnat-pool-1
  set security nat destination rule-set dst-nat rule rule2 match destination-address 10.1.2.100/24
  set security nat destination rule-set dst-nat rule rule2 match destination-port 443
  set security nat destination rule-set dst-nat rule rule2 then destination-nat pool dnat-pool-2
  set security zones security-zone trust address-book address ftpserver 192.168.0.9
  set security zones security-zone trust address-book address mailserver 172.16.0.12
  set security zones security-zone trust address-book address-set servergroup address ftpserver
  set security zones security-zone trust address-book address-set servergroup address mailserver
  set security policies from-zone untrust to-zone trust policy static-nat match source-address any destination-address servergroup application junos-http
  set security policies from-zone untrust to-zone trust policy static-nat match application junos-pop3
  set security policies from-zone untrust to-zone trust policy static-nat then permit
  set applications application 443 protocol tcp
  set applications application 443 destination-port 443
  ##############################################################
  set security nat source rule-set sou-nat from zone trust
  set security nat source rule-set sou-nat to zone untrust
  set security nat source rule-set sou-nat rule rule-mail match source-address 172.16.0.30/32
  set security nat source rule-set sou-nat rule rule-mail match destination-address 0.0.0.0/0
  set security nat source rule-set sou-nat rule rule-mail then source-nat pool pool-1
  ##############################################################
  管理端口:
  set system services web-management https
  set system services web-management http
  set system services web-management http port 8084
  set system services web-management http interface all
  set system services web-management https system-generated-certificate
  set system services web-management http interface ge-0/0/0.0
  set system services web-management https interface ge-0/0/0.0
  ###########################################################################
  定义端口地址池XXX_group:
  set applications application smtp_25 destination-port 25 protocol tcp
  set applications application pop3_110 destination-port 110 protocol tcp
  set applications application exchange_135 destination-port 135 protocol tcp
  set applications application smtp_465 destination-port 465 protocol tcp
  set applications application imap_993 destination-port 993 protocol tcp
  set applications application pop3_995 destination-port 995 protocol tcp
  set applications application-set mail_port_group application smtp_25
  set applications application-set XXX_group application smtp
  set applications application-set XXX_group application pop3
  引用XXX_group:
  set security policies from-zone untrust to-zone trust policy mail-policy match application XXX_group
  ##############################################################################
  反向静态NAT:从外到内
  set security nat static rule-set mail-static-nat from zone untrust
  set security nat static rule-set mail-static-nat rule mail1 match destination-address 121.9.255.150/32
  set security nat static rule-set mail-static-nat rule mail1 then static-nat prefix 172.16.0.12/32
  返回的安全Policy:
  set security policies from-zone untrust to-zone trust policy mail-policy match source-address any
  set security policies from-zone untrust to-zone trust policy mail-policy match destination-address Mail_ser
  set security policies from-zone untrust to-zone trust policy mail-policy match application any (XXX_group)
  set security policies from-zone untrust to-zone trust policy mail-policy then permit
  插入insert Policy:
  set security zones security-zone trust address-book address deny_172 172.16.0.155
  set security policies from-zone trust to-zone untrust policy deny_172 match source-address deny_172
  set security policies from-zone trust to-zone untrust policy deny_172 match destination-address any
  set security policies from-zone trust to-zone untrust policy deny_172 match application any
  set security policies from-zone trust to-zone untrust policy deny_172 then deny
  insert security policies from-zone trust to-zone untrust policy deny_172 before policy         Trust2Utrust (Trust2Utrust允许上公网策略)
  #####################################################
  禁止192网段上网,只允许192.168.0.2,192.168.0.121上网
  set security zones security-zone trust address-book address deny_192 192.168.0.0/23
  set security zones security-zone trust address-book address permit_host_2 192.168.0.2/32
  set security zones security-zone trust address-book address permit_host_121 192.168.0.121/32
  set security zones security-zone trust address-book address-set permit_192_online address FTP_ser
  set security zones security-zone trust address-book address-set permit_192_online address permit_host_2
  set security zones security-zone trust address-book address-set permit_192_online address permit_host_121
  set security zones security-zone trust address-book address-set deny_192_online address deny_192
  返回的安全Policy:
  set security policies from-zone trust to-zone untrust policy permit_192_online match source-address permit_192_online
  set security policies from-zone trust to-zone untrust policy permit_192_online match destination-address any
  set security policies from-zone trust to-zone untrust policy permit_192_online match application any
  set security policies from-zone trust to-zone untrust policy permit_192_online then permit
  set security policies from-zone trust to-zone untrust policy deny_192_online match source-address deny_192_online
  set security policies from-zone trust to-zone untrust policy deny_192_online match destination-address any
  set security policies from-zone trust to-zone untrust policy deny_192_online match application any
  set security policies from-zone trust to-zone untrust policy deny_192_online then deny
  insert security policies from-zone trust to-zone untrust policy permit_192_online before policy deny_172
  insert security policies from-zone trust to-zone untrust policy deny_192_online before policy deny_172
  ###########################################################################
  配置WEB管理
  set system host-name Test
  set system root-authentication encrypted-password "$1$XKPZUqwc$/WdxM1Cc1GAB8gJ0nNCOt."
  set system name-server 202.96.128.166
  set system name-server 202.96.128.86
  set system login user admin uid 2001

  set system login user admin>  set system login user admin authentication encrypted-password HJuZerSULPfkA
  set system services ssh
  set system services web-management http port 8084
  set system services web-management http interface all
  set system services web-management http interface ge-0/0/0.0
  set system services web-management https system-generated-certificate
  set system services web-management https interface ge-0/0/0.0
  set interfaces ge-0/0/0 unit 0 family inet address 192.168.8.125/24
  set interfaces ge-0/0/1 unit 0 family inet address 192.168.1.1/24
  set security zones security-zone untrust host-inbound-traffic system-services http
  set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services http
  ###########################################################################
  开放Untrust服务端口
  set security zones security-zone untrust interfaces ge-0/0/0.0
  set security zones security-zone untrust host-inbound-traffic system-services all
  set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services all
  set security zones security-zone trust interfaces ge-0/0/1.0
  set security zones security-zone trust host-inbound-traffic system-services all
  set security zones security-zone trust interfaces ge-0/0/1.0 host-inbound-traffic system-services all
  配置默认路由+NAT
  set routing-options static route 0.0.0.0/0 next-hop 192.168.8.1
  set security nat source rule-set sou-nat from zone trust
  set security nat source rule-set sou-nat to zone untrust
  set security nat source rule-set sou-nat rule rule-sou match source-address 0.0.0.0/0
  set security nat source rule-set sou-nat rule rule-sou match destination-address 0.0.0.0/0
  set security nat source rule-set sou-nat rule rule-sou then source-nat interface
  内网放行策略:
  set security policies from-zone trust to-zone untrust policy in_out match source-address any
  set security policies from-zone trust to-zone untrust policy in_out match destination-address any
  set security policies from-zone trust to-zone untrust policy in_out match application any
  set security policies from-zone trust to-zone untrust policy in_out then permit

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-542074-1-1.html 上篇帖子: juniper-Backspace 下篇帖子: 实用juniper SRX NAT小技巧。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表