Juniper SRX240 subinterfejsy i NAT

JunOS / Juniper / Netscreen
Wiadomość
Autor
fisch
member
member
Posty: 17
Rejestracja: 25 sty 2011, 19:55

#16

#16 Post autor: fisch »

To ip nat inside source static 172.16.10.5 64.64.64.65 nie dotyczy PIX-a.

Co do PIX to jeszcze byłby problem co zrobić z wpisami właśnie tymi
static (inside,outside) 212.x 172.16.5.167 netmask 255.255.255.255 0 0
Jak przerobić (inside,outside) na Junipera ?

b4n3
wannabe
wannabe
Posty: 128
Rejestracja: 25 cze 2010, 09:58

#17

#17 Post autor: b4n3 »

No to robisz destination nat, jak poniżej

Kod: Zaznacz cały

destination {
            pool LOCAL {
                address 172.16.5.167/32 port 14401; (port inside, jeśli trzeba)
            }
            rule-set FROM-PUBLIC {
                from zone EXTERNAL;
                rule PUBLIC-01 {
                    match {
                        source-address 8.8.8.8/32; (lub ANY)
                        destination-address 212.x.x.x/32;
                                        
                        destination-port 14402; (po stronie outside, jeśli trzeba)
                    }
                    then {
                        destination-nat pool LOCAL;
                    }
                }
            }
        }

fisch
member
member
Posty: 17
Rejestracja: 25 sty 2011, 19:55

#18

#18 Post autor: fisch »

Ponieważ już jakiś czas temu poradziłem sobie z problemami przy przenoszeniu konfiguracji z PIX-a na Junipera to przedstawię opis rozwiązania problemu.
Konfiguracja posiada kilka adresów IP zewnętrznych.
Aby działały wpisy NAT każdy z użytych adresów musiał zostać przypisany do interfejsu zewnętrznego. Tu nie ma czegoś takiego jak w CISCO ip nat inside i ip nat outside.
NAT źródłowy stosowany jest na jeden adres IP. Ponieważ adresów jest kilka przeładowanie nie może być poprzez interfejs tylko przez pulę adresów - tutaj pula składa się dokładnie z jednego adresu.
NAT statyczny, jak i dynamiczny wymagał ustawienia określonych polityk dostępu.
Kolejnym problemem był VPN. VPN próbował łączyć się z najniższego adresu przypisanego do interfejsu, a nie z tego na który negocjowała połączenie druga strona tunelu. Problem rozwiązałem dodając przy konkretnym adresie IP wpis primary; preferred;
Parametrów primary; prefered; nie znalazłem w graficznym interfejsie www i dodałem to przez CLI Editor.
Przy konfiguracji VPN pomógł mi ten artykuł: http://kb.juniper.net/InfoCenter/index? ... id=KB28037

Kod: Zaznacz cały

## Last changed: 2014-04-11 13:36:10 CEST
version 11.4R5.5;
system {
    .....................................
}
interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address ....................134/30 {
                    primary;
                    preferred;
                }
                address ...............65/27;
                address ...............72/27;
		address ...............73/27;
                ................................
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan-trust;
                }
            }
        }
    }
    ge-0/0/2 {
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan-trust;
                }
            }
        }
    }
  .............................................
    st0 {
        unit 0 {
            family inet;
        }
    }
    vlan {
        unit 0 {
            family inet {
                address 172.16...../16;
            }
        }
    }
}
routing-options {
    static {
        route 0.0.0.0/0 next-hop ................133;
        route 172.19.0.0/16 next-hop st0.0;
    }
}
protocols {
    stp;
}
security {
    ike {
        ..................................
    }
    screen {
        ..................................
    }
    nat {
        source {
            pool pula {
                address {
                    ..................65/27 to ..................65/27;
                }
            }
            rule-set source-nat-rule {
                from zone trust;
                to zone untrust;
                rule trust-to-untrust {
                    match {
                        source-address 172.16.0.0/16;
                    }
                    then {
                        source-nat {
                            pool {
                                pula;
                            }
                        }
                    }
                }
            }
        }
        static {
            rule-set static_1 {
                from zone untrust;
                rule static_1 {
                    match {
                        destination-address ...............73/32;
                    }
                    then {
                        static-nat {
                            prefix {
                                .....................;
                            }
                        }
                    }
                }
               ......................................
    policies {
        from-zone trust to-zone untrust {
..........................................................
            policy trust-to-untrust {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone untrust to-zone trust {
           ..........................................
            policy untrust-to-trust {
                match {
                    source-address any;
                    destination-address ..........................................;
                    application ........................................;
                }
                then {
                    permit;
                }
            }
        }
        from-zone trust to-zone trust {
           ....................................................
    }
    zones {
        security-zone trust {
            address-book {
               ..............................................
            }
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                vlan.0;
                st0.0;
            }
        }
        security-zone untrust {
            address-book {
                ..............................................
            }
            screen untrust-screen;
            interfaces {
                ge-0/0/0.0 {
                    host-inbound-traffic {
                        system-services {
                            ...................
                        }
                    }
                }
            }
        }
    }
}
vlans {
    vlan-trust {
        vlan-id 3;
        l3-interface vlan.0;
    }
}

ODPOWIEDZ