设为首页收藏本站language 语言切换
查看: 1324|回复: 0
收起左侧

请教:JUNOS两个VLAN间如何互访

[复制链接]
发表于 2014-6-1 03:36:57 | 显示全部楼层 |阅读模式
本帖最后由 vsyour 于 2014-6-1 03:40 编辑

需求:需要使41网站能与42网段互访问
配置如下:
  1. root# show
  2. ## Last changed: 2014-06-01 03:26:41 UTC
  3. version 11.2R4.3;
  4. system {
  5.     root-authentication {
  6.         encrypted-password "$1$q2cFqzqY$RBARpNab0Z.25Kr31.BBj/"; ## SECRET-DATA
  7.     }
  8.     name-server {
  9.         8.8.8.8;
  10.     }
  11.     services {
  12.         ssh;
  13.         telnet;
  14.         xnm-clear-text;
  15.         web-management {
  16.             http {
  17. Filename:
  18.                 interface vlan.3;
  19.             }
  20.             https {
  21.                 system-generated-certificate;
  22.                 interface vlan.3;
  23.             }
  24.         }
  25.     }
  26.     syslog {
  27.         archive size 100k files 3;
  28.         user * {
  29.             any emergency;
  30.         }
  31.         file messages {
  32.             any critical;
  33.             authorization info;
  34.         }
  35.         file interactive-commands {
  36.             interactive-commands error;
  37.         }
  38.     }
  39.     max-configurations-on-flash 5;
  40.     max-configuration-rollbacks 5;
  41.     license {
  42.         autoupdate {
  43.             url https://ae1.juniper.net/junos/key_retrieval;
  44.         }
  45.     }
  46. }
  47. interfaces {
  48.     ge-0/0/0 {
  49.         unit 0 {
  50.             family inet {
  51.                 address 192.168.1.180/24;
  52.             }
  53.         }
  54.     }
  55.     ge-0/0/1 {
  56.         unit 0 {
  57.             family ethernet-switching {
  58.                 vlan {
  59.                     members 3;
  60.                 }
  61.             }
  62.         }
  63.     }
  64.     ge-0/0/2 {
  65.         unit 0 {
  66.             family ethernet-switching {
  67.                 vlan {
  68.                     members 3;
  69.                 }
  70.             }
  71.         }
  72.     }
  73.     ge-0/0/3 {
  74.         unit 0 {
  75.             family ethernet-switching {
  76.                 vlan {
  77.                     members 3;
  78.                 }
  79.             }
  80.         }
  81.     }
  82.     ge-0/0/4 {
  83.         unit 0 {
  84.             family ethernet-switching {
  85.                 vlan {
  86.                     members 3;
  87.                 }
  88.             }
  89.         }
  90.     }
  91.     ge-0/0/5 {
  92.         unit 0 {
  93.             family ethernet-switching {
  94.                 vlan {
  95.                     members 3;
  96.                 }
  97.             }
  98.         }
  99.     }
  100.     ge-0/0/6 {
  101.         unit 0 {
  102.             family ethernet-switching {
  103.                 vlan {
  104.                     members 4;
  105.                 }
  106.             }
  107.         }
  108.     }
  109.     ge-0/0/7 {
  110.         unit 0 {
  111.             family ethernet-switching {
  112.                 vlan {
  113.                     members 4;
  114.                 }
  115.             }
  116.         }
  117.     }
  118.     vlan {
  119.         unit 3 {
  120.             family inet {
  121.                 address 172.20.42.250/24;
  122.             }
  123.         }
  124.         unit 4 {
  125.             family inet {
  126.                 address 172.20.41.250/24;
  127.             }
  128.         }
  129.     }
  130. }
  131. routing-options {
  132.     static {
  133.         route 0.0.0.0/0 next-hop 192.168.1.2;
  134.     }
  135. }
  136. protocols {
  137.     stp;
  138. }
  139. security {
  140.     screen {
  141.         ids-option untrust-screen {
  142.             icmp {
  143.                 ping-death;
  144.             }
  145.             ip {
  146.                 source-route-option;
  147.                 tear-drop;
  148.             }
  149.             tcp {
  150.                 syn-flood {
  151.                     alarm-threshold 1024;
  152.                     attack-threshold 200;
  153.                     source-threshold 1024;
  154.                     destination-threshold 2048;
  155.                     timeout 20;
  156.                 }
  157.                 land;
  158.             }
  159.         }
  160.     }
  161.     nat {
  162.         source {
  163.             rule-set dmz-to-untrust {
  164.                 from zone dmz;
  165.                 to zone untrust;
  166.                 rule source-net-rule {
  167.                     match {
  168.                         source-address 0.0.0.0/0;
  169.                         destination-address 0.0.0.0/0;
  170.                     }
  171.                     then {
  172.                         source-nat {
  173.                             interface;
  174.                         }
  175.                     }
  176.                 }
  177.             }
  178.         }
  179.     }
  180.     policies {
  181.         from-zone dmz to-zone untrust {
  182.             policy dmz-to-untrust {
  183.                 match {
  184.                     source-address dmz-group;
  185.                     destination-address any;
  186.                     application any;
  187.                 }
  188.                 then {
  189.                     permit;
  190.                 }
  191.             }
  192.         }
  193.         from-zone dmz to-zone trust {
  194.             policy 003 {
  195.                 match {
  196.                     source-address any;
  197.                     destination-address any;
  198.                     application any;
  199.                 }
  200.                 then {
  201.                     permit;
  202.                 }
  203.             }
  204.         }
  205.         from-zone trust to-zone dmz {
  206.             policy 003 {
  207.                 match {
  208.                     source-address any;
  209.                     destination-address any;
  210.                     application any;
  211.                 }
  212.                 then {
  213.                     permit;
  214.                 }
  215.             }
  216.         }
  217.     }
  218.     zones {
  219.         security-zone trust {
  220.             address-book {
  221.                 address trust-1 172.20.41.1/32;
  222.                 address trust-2 172.20.41.2/32;
  223.                 address trust-3 172.20.41.3/32;
  224.                 address-set trust-group {
  225.                     address trust-1;
  226.                     address trust-2;
  227.                     address trust-3;
  228.                 }
  229.             }
  230.             host-inbound-traffic {
  231.                 system-services {
  232.                     all;
  233.                 }
  234.                 protocols {
  235.                     all;
  236.                 }
  237.             }
  238.             interfaces {
  239.                 vlan.4;
  240.             }
  241.         }
  242.         security-zone untrust {
  243.             screen untrust-screen;
  244.             interfaces {
  245.                 ge-0/0/0.0 {
  246.                     host-inbound-traffic {
  247.                         system-services {
  248.                             dhcp;
  249.                             tftp;
  250.                             ping;
  251.                             ssh;
  252.                         }
  253.                     }
  254.                 }
  255.             }
  256.         }
  257.         security-zone dmz {
  258.             address-book {
  259.                 address dmz-1 172.20.42.1/32;
  260.                 address dmz-2 172.20.42.2/32;
  261.                 address-set dmz-group {
  262.                     address dmz-1;
  263.                     address dmz-2;
  264.                 }
  265.             }
  266.             host-inbound-traffic {
  267.                 system-services {
  268.                     all;
  269.                 }
  270.                 protocols {
  271.                     all;
  272.                 }
  273.             }
  274.             interfaces {
  275.                 vlan.3;
  276.             }
  277.         }
  278.     }
  279. }
  280. vlans {
  281.     vlan-dmz {
  282.         vlan-id 3;
  283.         l3-interface vlan.3;
  284.     }
  285.     vlan-trust {
  286.         vlan-id 4;
  287.         l3-interface vlan.4;
  288.     }
  289. }

  290. [edit]
  291. root#
复制代码
  1. set version 11.2R4.3
  2. set system root-authentication encrypted-password "$1$q2cFqzqY$RBARpNab0Z.25Kr31.BBj/"
  3. set system name-server 8.8.8.8
  4. set system services ssh
  5. set system services telnet
  6. set system services xnm-clear-text
  7. set system services web-management http interface vlan.3
  8. set system services web-management https system-generated-certificate
  9. set system services web-management https interface vlan.3
  10. set system syslog archive size 100k
  11. set system syslog archive files 3
  12. set system syslog user * any emergency
  13. set system syslog file messages any critical
  14. set system syslog file messages authorization info
  15. set system syslog file interactive-commands interactive-commands error
  16. set system max-configurations-on-flash 5
  17. set system max-configuration-rollbacks 5
  18. set system license autoupdate url https://ae1.juniper.net/junos/key_retrieval
  19. set interfaces ge-0/0/0 unit 0 family inet address 192.168.1.180/24
  20. set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members 3
  21. set interfaces ge-0/0/2 unit 0 family ethernet-switching vlan members 3
  22. set interfaces ge-0/0/3 unit 0 family ethernet-switching vlan members 3
  23. set interfaces ge-0/0/4 unit 0 family ethernet-switching vlan members 3
  24. set interfaces ge-0/0/5 unit 0 family ethernet-switching vlan members 3
  25. set interfaces ge-0/0/6 unit 0 family ethernet-switching vlan members 4
  26. set interfaces ge-0/0/7 unit 0 family ethernet-switching vlan members 4
  27. set interfaces vlan unit 3 family inet address 172.20.42.250/24
  28. set interfaces vlan unit 4 family inet address 172.20.41.250/24
  29. set routing-options static route 0.0.0.0/0 next-hop 192.168.1.2
  30. set protocols stp
  31. set security screen ids-option untrust-screen icmp ping-death
  32. set security screen ids-option untrust-screen ip source-route-option
  33. set security screen ids-option untrust-screen ip tear-drop
  34. set security screen ids-option untrust-screen tcp syn-flood alarm-threshold 1024
  35. set security screen ids-option untrust-screen tcp syn-flood attack-threshold 200
  36. set security screen ids-option untrust-screen tcp syn-flood source-threshold 1024
  37. set security screen ids-option untrust-screen tcp syn-flood destination-threshold 2048
  38. set security screen ids-option untrust-screen tcp syn-flood timeout 20
  39. set security screen ids-option untrust-screen tcp land
  40. set security nat source rule-set dmz-to-untrust from zone dmz
  41. set security nat source rule-set dmz-to-untrust to zone untrust
  42. set security nat source rule-set dmz-to-untrust rule source-net-rule match source-address 0.0.0.0/0
  43. set security nat source rule-set dmz-to-untrust rule source-net-rule match destination-address 0.0.0.0/0
  44. set security nat source rule-set dmz-to-untrust rule source-net-rule then source-nat interface
  45. set security policies from-zone dmz to-zone untrust policy dmz-to-untrust match source-address dmz-group
  46. set security policies from-zone dmz to-zone untrust policy dmz-to-untrust match destination-address any
  47. set security policies from-zone dmz to-zone untrust policy dmz-to-untrust match application any
  48. set security policies from-zone dmz to-zone untrust policy dmz-to-untrust then permit
  49. set security policies from-zone dmz to-zone trust policy 003 match source-address any
  50. set security policies from-zone dmz to-zone trust policy 003 match destination-address any
  51. set security policies from-zone dmz to-zone trust policy 003 match application any
  52. set security policies from-zone dmz to-zone trust policy 003 then permit
  53. set security policies from-zone trust to-zone dmz policy 003 match source-address any
  54. set security policies from-zone trust to-zone dmz policy 003 match destination-address any
  55. set security policies from-zone trust to-zone dmz policy 003 match application any
  56. set security policies from-zone trust to-zone dmz policy 003 then permit
  57. set security zones security-zone trust address-book address trust-1 172.20.41.1/32
  58. set security zones security-zone trust address-book address trust-2 172.20.41.2/32
  59. set security zones security-zone trust address-book address trust-3 172.20.41.3/32
  60. set security zones security-zone trust address-book address-set trust-group address trust-1
  61. set security zones security-zone trust address-book address-set trust-group address trust-2
  62. set security zones security-zone trust address-book address-set trust-group address trust-3
  63. set security zones security-zone trust host-inbound-traffic system-services all
  64. set security zones security-zone trust host-inbound-traffic protocols all
  65. set security zones security-zone trust interfaces vlan.4
  66. set security zones security-zone untrust screen untrust-screen
  67. set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services dhcp
  68. set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services tftp
  69. set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ping
  70. set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ssh
  71. set security zones security-zone dmz address-book address dmz-1 172.20.42.1/32
  72. set security zones security-zone dmz address-book address dmz-2 172.20.42.2/32
  73. set security zones security-zone dmz address-book address-set dmz-group address dmz-1
  74. set security zones security-zone dmz address-book address-set dmz-group address dmz-2
  75. set security zones security-zone dmz host-inbound-traffic system-services all
  76. set security zones security-zone dmz host-inbound-traffic protocols all
  77. set security zones security-zone dmz interfaces vlan.3
  78. set vlans vlan-dmz vlan-id 3
  79. set vlans vlan-dmz l3-interface vlan.3
  80. set vlans vlan-trust vlan-id 4
  81. set vlans vlan-trust l3-interface vlan.4

  82. [edit]
复制代码
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-12 12:19 , Processed in 0.062743 second(s), 22 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

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