SRX

last person joined: 4 days ago 

Ask questions and share experiences about the SRX Series, vSRX, and cSRX.
  • 1.  VLAN trunking & configuration between a SRX220 and Cisco 3550

    Posted 06-05-2015 10:13

    Hello,

     

    I'm new to VLANs on JUNOS, and I'm trying to create VLANs on the SRX220 with a trunk to a Cisco Catalyst 3550-12T.

     

    This is my current setup;

     

    SRX220 port 8 (mode = trunk, all VLANs) <-> 3550 port 1 (switchport mode trunk, encapsulation dot1q)
    SRX220 has the IP of 10.0.0.1/24. Cisco 3550's management interface is 10.0.0.2/24.

     

    I could ping the SRX220 from the 3550, also pinging 8.8.8.8 from the catalyst switch is possible. Also, I've tried setting up port 7 on the SRX220 as an access port for, say, VLAN 5 (which is identified in the SRX's CLI as vlan.6) - and able to ping the catalyst's IP for that VLAN.

     

    There are a few problems, some of which may be off topic:

     

    - If I connect my laptop to an access port on the catalyst switch, and configured a fixed IP address on that VLAN, say 10.100.5.20 (network's 10.100.5.1/24), I couldn't ping that device from the SRX220 itself.

    - The catalyst 3550 could ping both the SRX220, and 8.8.8.8 - however, devices connected to an access port on the catalyst couldn't ping 8.8.8.8, the SRX220, or any other site on the internet.

     

    I'm not sure if this problem comes from the SRX side, or the catalyst side, or both...

     

    Some additional questions I'd like to ask:

    - How do you configure multi-DHCP for multiple VLANs on the SRX?

    - How do you configure inter-VLAN firewall policies and routing on the SRX?

     

    Issuing the "show route" command on the SRX showed this info (shortened version from the full list):

     

    10.100.5.0/24      *[Direct/0] 03:49:11
                        > via vlan.6
    10.100.5.1/32      *[Local/0] 03:49:26
                          Local via vlan.6

     

    This is my configuration for the SRX220:

     

        interfaces {                            
        ge-0/0/0 {                          
            unit 0 {                        
                encapsulation ppp-over-ether;
            }                               
        }                                   
        ge-0/0/1 {                          
            unit 0 {                        
                family ethernet-switching { 
                    vlan {                  
                        members vlan1;      
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/2 {                          
            unit 0 {                        
                family ethernet-switching { 
                    vlan {                  
                        members vlan1;      
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/3 {                          
            unit 0 {                        
                family ethernet-switching { 
                    vlan {                  
                        members vlan1;      
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/4 {                          
            unit 0 {                        
                family ethernet-switching { 
                    vlan {                  
                        members vlan1;      
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/5 {                          
            unit 0 {                        
                family ethernet-switching { 
                    vlan {                  
                        members vlan1;      
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/6 {                          
            unit 0 {                        
                family ethernet-switching { 
                    port-mode access;       
                    vlan {                  
                        members Office-VLAN;
                    }                       
                }                           
            }                               
        }                                   
        ge-0/0/7 {                          
            unit 0 {                        
                family ethernet-switching { 
                    port-mode trunk;        
                    vlan {                  
                        members all;        
                    }                       
                }                           
            }                               
        }                                   
        pp0 {                               
            unit 0 {                        
                apply-macro internet-fttx;       
                ppp-options {               
                    chap {                  
                        default-chap-secret [secret-data]
                        local-name "internet-username@fttxservice";
                        no-rfc2486;         
                        passive;            
                    }                       
                    pap {                   
                        local-name "internet-username@fttxservice";
                        no-rfc2486;         
                        local-password [secret-data]
                        passive;            
                    }                       
                }                           
                pppoe-options {             
                    underlying-interface ge-0/0/0.0;
                }                           
                family inet {               
                    negotiate-address;      
                }                           
            }                               
        }                                   
        vlan {                              
            unit 1 {                        
                family inet {               
                    address 10.0.0.1/24;    
                }                           
            }                               
            unit 2 {                        
                family inet {               
                    address 10.100.9.1/24;  
                }                           
            }                               
            unit 3 {                        
                family inet {               
                    address 10.100.8.1/24;  
                }                           
            }                               
            unit 4 {                        
                family inet {               
                    address 10.100.7.1/24;  
                }                           
            }                               
            unit 5 {                        
                family inet {               
                    address 10.100.6.1/24;  
                }                           
            }                               
            unit 6 {                        
                family inet {               
                    address 10.100.5.1/24;  
                }                           
            }                               
        }                                   
    }                                                                            
    routing-options {                       
        static {                            
            route 0.0.0.0/0 {               
                next-hop pp0.0;             
                qualified-next-hop pp0.0 {  
                    metric 1;               
                }                           
            }                               
        }                                   
    }                                       
    protocols {                             
        stp;                                
    }                                       
    security {                              
        screen {                            
            ids-option untrust-screen {     
                icmp {                      
                    ping-death;             
                }                           
                ip {                        
                    source-route-option;    
                    tear-drop;              
                }                           
                tcp {                       
                    syn-flood {             
                        alarm-threshold 1024;
                        attack-threshold 200;
                        source-threshold 1024;
                        destination-threshold 2048;
                        timeout 20;         
                    }                       
                    land;                   
                }                           
            }                               
        }                                   
        nat {                               
            source {                        
                rule-set nsw_srcnat {       
                    from zone Internal;     
                    to zone Internet;       
                    rule nsw-src-interface {
                        match {             
                            source-address 0.0.0.0/0;
                            destination-address 0.0.0.0/0;
                        }                   
                        then {              
                            source-nat {    
                                interface;  
                            }               
                        }                   
                    }                       
                }                           
            }                               
        }                                   
        policies {                          
            from-zone Internal to-zone Internet {
                policy All_Internal_Internet {
                    match {                 
                        source-address any; 
                        destination-address any;
                        application any;    
                    }                       
                    then {                  
                        permit;             
                    }                       
                }                           
            }                               
        }                                   
        zones {                             
            security-zone Internal {        
                interfaces {                
                    vlan.1 {                
                        host-inbound-traffic {
                            system-services {
                                all;        
                                http;       
                                https;      
                                ssh;        
                            }               
                            protocols {     
                                all;        
                            }               
                        }                   
                    }                       
                }                           
            }                               
            security-zone Internet {        
                screen untrust-screen;      
                interfaces {                
                    pp0.0;                  
                }                           
            }                               
        }                                   
    }                                       
    vlans {                                 
        Automation-VLAN {                   
            description "Automation Devices VLAN";
            vlan-id 6;                      
            l3-interface vlan.5;            
        }                                   
        Office-VLAN {                       
            description "Office Network VLAN";
            vlan-id 5;                      
            l3-interface vlan.6;            
        }                                   
        Server-VLAN {                       
            description "Server (DMZ) VLAN";
            vlan-id 9;                      
            l3-interface vlan.2;            
        }                                   
        Wifi-Client-VLAN {                  
            description "Wireless Network Client VLAN";
            vlan-id 8;                      
            l3-interface vlan.3;            
        }                                   
        Wifi-Devices-VLAN {                 
            description "Wireless Network Devices/APs VLAN";
            vlan-id 7;                      
            l3-interface vlan.4;            
        }                                   
        vlan1 {                             
            vlan-id 3;                      
            l3-interface vlan.1;            
        }                                   
    }    

     

    And this is my configuration for the Catalyst 3550

    (I've not configured any other port other than GigabitEthernet0/1, the trunk port, and GigabitEthernet0/10, the access port. Others are left at their default value.)

     

    !
    spanning-tree mode pvst
    spanning-tree extend system-id
    !         
    vlan internal allocation policy ascending
    !    
    !         
    interface GigabitEthernet0/1
     switchport trunk encapsulation dot1q
     switchport mode trunk
    !         
    interface GigabitEthernet0/2
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/3
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/4
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/5
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/6
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/7
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/8
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/9
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/10
     switchport access vlan 5
     switchport mode access
    !         
    interface GigabitEthernet0/11
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface GigabitEthernet0/12
     switchport access vlan 3
     switchport trunk native vlan 3
     switchport mode dynamic desirable
    !         
    interface Vlan1
     no ip address
    !         
    interface Vlan3
     ip address 10.0.0.2 255.255.255.0
    !         
    interface Vlan5
     ip address 10.100.5.1 255.255.255.0
    !         
    interface Vlan6
     no ip address
    !         
    interface Vlan9
     ip address 10.100.9.1 255.255.255.0
    !         
    ip default-gateway 10.0.0.1
    ip classless
    ip route 0.0.0.0 0.0.0.0 10.0.0.1
    ip http server
    ip http secure-server
    !         
    !         
    !         
    control-plane
    !         
    !         
    line con 0
     exec-timeout 0 0
    line vty 0 4
     password [secret-data]
     login    
    line vty 5 15
     password [secret-data]
     login    
    !         
    end 

    Thank you!

    Namo.

     

     



  • 2.  RE: VLAN trunking & configuration between a SRX220 and Cisco 3550
    Best Answer

     
    Posted 06-05-2015 12:35

    Hi,

     

    See my config below!! you need to check it for typo's in address space

     

    You need to add the vlan.6 interface into a security-zone, Let me guess you want to build a new zone for this office-vlan ?

     

    set security zones security-zone OFFICE

    set security zones security-zone OFFICE interfaces vlan.6 host-inbound-traffic system-services ping

    set security zones security-zone OFFICE interfaces vlan.6 host-inbound-traffic system-services ssh

    set security zones security-zone OFFICE interfaces vlan.6 host-inbound-traffic system-services dhcp

    set security zones security-zone OFFICE interfaces vlan.6 host-inbound-traffic system-services http

    set security zones security-zone OFFICE interfaces vlan.6 host-inbound-traffic system-services dns

     

    Now you have added the interface to a security zone. Now you can ping your laptop from the srx and otherwise

     

     

    To reach the internet you have to create a nat policy

    and a security policy that is allowing traffic from the zone towards the internet

     

    security policy:

     

    set security zones security-zone OFFICE address-book address NET-LAN-OFFICE 10.100.5.0/24

     

    set security policies from-zone OFFICE to-zone Internet policy default-permit match source-address NET-LAN-OFFICE
    set security policies from-zone OFFICE to-zone Internet policy default-permit match destination-address any
    set security policies from-zone OFFICE to-zone Internet policy default-permit match application any
    set security policies from-zone OFFICE to-zone Internet policy default-permit then permit

     

    nat ruleset:

     

    set security nat source address-persistent
    set security nat source rule-set interface-nat from zone OFFICE
    set security nat source rule-set interface-nat to zone Internet
    set security nat source rule-set interface-nat rule rule1 match source-address 10.100.5.0/24
    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

     

     

    Inter zone traffic:

     

    lets say you want to allow traffic from the office zone to the management zone to have access from your office network

    to the mangement network.

     

    set security policies from-zone OFFICE to-zone Internal policy access_to_srx01 match source-address any
    set security policies from-zone OFFICE to-zone Internal policy access_to_srx01 match destination-address any
    set security policies from-zone OFFICE to-zone Internal policy access_to_srx01 match application any
    set security policies from-zone OFFICE to-zone Internal policy access_to_srx01 then permit

     

    (At this moment everything comming from the office zone to the internal zone is allowed. You can make it more secure.

     

     

    Multiple dhcp statements:

     

     

    set access address-assignment pool Internal family inet network 10.0.0.1/24
    set access address-assignment pool Internal family inet range Internal low 10.0.0.30
    set access address-assignment pool Internal family inet range Internal high 10.0.0.250
    set access address-assignment pool Internal family inet dhcp-attributes maximum-lease-time 259200
    set access address-assignment pool Internal family inet dhcp-attributes grace-period 259200
    set access address-assignment pool Internal family inet dhcp-attributes domain-name internal.lan.tld
    set access address-assignment pool Internal family inet dhcp-attributes name-server x.x.x.x
    set access address-assignment pool Internal family inet dhcp-attributes name-server x.x.x.x
    set access address-assignment pool Internal family inet dhcp-attributes router 10.0.0.1
    set access address-assignment pool Internal family inet host no-clue hardware-address 00:15:fc:1e:01:32
    set access address-assignment pool Internal family inet host no-clue ip-address 10.0.0.31

    set access address-assignment pool OFFICE family inet network 10.100.6.0/24
    set access address-assignment pool OFFICE family inet range OFFICE low 10.100.6.150
    set access address-assignment pool OFFICE family inet range OFFICE high 10.100.6.200
    set access address-assignment pool OFFICE family inet dhcp-attributes maximum-lease-time 259200
    set access address-assignment pool OFFICE family inet dhcp-attributes domain-name office.domain.tld
    set access address-assignment pool OFFICE family inet dhcp-attributes name-server x.x.x.x
    set access address-assignment pool OFFICE family inet dhcp-attributes name-server x.x.x.x
    set access address-assignment pool OFFICE family inet dhcp-attributes router 10.100.6.1

     


    set system services dhcp-local-server group Internal interface vlan.1
    set system services dhcp-local-server group OFFICE interface vlan.6

     

    Hope this helps you a bit