Forum index CCIE.pl
site 4 CCIE wannabies

FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  StatisticsStatistics
RegisterRegister  Log inLog in  AlbumAlbum

Previous topic «» Next topic
NAT prosba o wyjasnienie
Author Message
dacula
wannabe



Helped: 2 times
Joined: 28 Jul 2008
Posts: 336
Posted: 29 January 2010, 21:38   NAT prosba o wyjasnienie

Witam,

musze skonfigurowac NAT na routerze Juniper, niestety mam do routera zdalny dostep i musze to zrobic przez weekend. W poniedzialek rano pojedzie na site i tam juz bede odciety, wiec musze miec pewnosc, ze moja konfiguracja jest wlasciwa, nie mam prawa sie pomylic :P

Wpadl mi w rece dokument dotyczacy source nat:

Code:
source {
address-persistent
pool <pool name> {
address {
<low address> to <high address>;
}
    {
pool-utilization-alarm {&#8230;}
rule-set <rule-set name>{
from {
interface <interface list>;
zone <zone list>;
routing-instace <routing-instance list>;
}
to {
interface <interface list>;
zone <zone list>;
routing-instance <routing-instance list>;
}
rule <rule-name> {
match {
source-address <source address/prefix list>;
destination-address <source address/prefix list>;
}
then source-nat {
inerface | off | pool <pool-name>;
}
}
}



Na routerze mam skonfigurowane trzy interfejsy, chce zrobic source na ge-0/0/1 na ge-0/0/0, od operatora mam port E1.


Czy w tym miejscu mam podac adres, na ktory bedzie sie odbywala translacja?

Code:
source {
address-persistent
pool <pool name> {
address {
<low address> to <high address>;
}
 
 
PioterPL
wannabe
CCNA



Joined: 16 Jun 2007
Posts: 137
Posted: 30 January 2010, 15:52   

Tu masz podstawową konfiguracje source nat na srx:

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 0.0.0.0/0 destination-address 0.0.0.0/0
set security nat source rule-set interface-nat rule rule1 then source-nat interface
set security policies from-zone trust to-zone untrust policy permit-all match source-address any destination-address any application any
set security policies from-zone trust to-zone untrust policy permit-all then permit
 
 
dacula
wannabe



Helped: 2 times
Joined: 28 Jul 2008
Posts: 336
Posted: 30 January 2010, 16:13   

Nie zdefiniowalem zonow.
Nikt nie da rady pomoc? Cos mi to nie chce dzialac :(
 
 
zis
CCIE


Joined: 14 Nov 2005
Posts: 203
Posted: 12 February 2010, 09:03   

dacula wrote:
Nie zdefiniowalem zonow.
Nikt nie da rady pomoc? Cos mi to nie chce dzialac :(

No niech i bedzie ... cos z pamieci napisze bo wiadomo ze srxami nie handluje ;) a junosa na J-kach nigdy nie widzialem :) ))

Lecmy od poczatku czyli 3 interfejsy
Code:

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 1.1.1.1/30;
            }
        }
    }
    ge-0/0/1 {
        unit 0 {
             family inet {
                address 10.10.10.254/24;
            }
        }
    }
    fe-0/0/7 {
        unit 0 {
            family inet {
                address 10.10.20.254/24;
            }
        }
}

Nastepnie ruting
Code:

routing-options {
    static {
        route 0.0.0.0/0 next-hop 1.1.1.1;

Nastepnie musisz skonfigurowac zony a poniewaz masz 3 interfejsy to mozesz je nazwac po ciscowemu jako outside, inside, i dmz

Code:
   zones {
        security-zone inside {
            tcp-rst;
            address-book {
                address local-net 10.10.10.0/24;
            }
            host-inbound-traffic {
                system-services {
                    all;
                }
            }
            interfaces {
                ge-0/0/1.0 {
                    host-inbound-traffic {
                        system-services {
                            all;
                        }
                    }
                }
               
         }
        security-zone outside {
            address-book {
                address out 1.1.1.1/30;
            }
                host-inbound-traffic {
                system-services {
                    ping;
                    https;
                    ssh;
                }
            }
            interfaces {
                ge-0/0/0.0 {
                    host-inbound-traffic {
                        system-services {
                            http;
                            https;
                            ike;
                            ssh;
                            ping;
                        }
                    }
                }
            }
        }
   security-zone dmz {
            address-book {
                address dmz 10.10.20.0/24;
            }
                host-inbound-traffic {
                system-services {
                    ping;
                    https;
                    ssh;
                }
            }
            interfaces {
                fe-0/0/7.0 {
                    host-inbound-traffic {
                        system-services {
                            http;
                            https;
                            ike;
                            ssh;
                            ping;
                        }
                    }
                }
            }


Jak juz masz zdefiniowane zony to teraz mozesz pobawic sie NATem

Code:
security {
    nat {
        source {
            rule-set NAT-LAN {
                from zone inside;
                to zone outside;
                rule Netz-LAN {
                    match {
                        source-address 10.10.10.0/24;
                        destination-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;

Co mniej wiecej oznacza ze pakiety z int inside z sieci 10.10.10.0/24 i begnace sobie w dowolnym IP na int outside zostana za PATowane.


Podobnie robisz dla ruchu z DMZ na outside a potem juz ustawiasz destination NAT dla uslug ktore maja byc widoczne w sieci.

No i na koniec definiujesz polityki ruchowe czyli skad ten biedny ruter ma wiedziec jaki pakiet przepuscic.

Code:

   policies {
        from-zone inside to-zone inside {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone inside to-zone outside {
            policy default-permit {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
         from-zone inside to-zone outside {
            policy permit-inside-to-dmz {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }


No to jakas baze juz masz. Jak napisalem na poczatku to konfig z pamieci wiec nalezy rozsadnie podchodzic do skladni.

EDIT: Do listingow konfiguracji, show, debug, etc uzywamy znacznikow [code] :!:
Seba
_________________
ZIS samo ZLO
Last edited by Seba on 12 February 2010, 11:42; edited 1 time in total  
 
 
Display posts from previous:   
Reply to topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Add this topic to your bookmarks
Printable version

Jump to:  

Powered by phpBB modified by Przemo © 2003 phpBB Group

This Website is not sponsored by, endorsed by or affiliated with Cisco Systems, Inc.
Cisco, Cisco Systems, CCDA, CCNA, CCDP, CCNP, CCIE, CCSI, CCIP, the Cisco Systems logo and the CCIE logo are trademarks or registered trademarks of Cisco Systems, Inc. in the United States and certain other countries.