728x90




R1
root@R1# run show configuration
## Last commit: 2011-06-23 16:10:40 UTC by root
version 10.0R3.10;
system {
    host-name R1;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.1/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.1;
    autonomous-system 2222;
}
protocols {
    bgp {          
        group expo {
            type external;
            export export_bgp;
            peer-as 65010;
            neighbor 192.168.1.2;
        }
    }
}
policy-options {
    policy-statement export_bgp {
        then accept;
    }
}

R2
[edit]
root@R2# run show configuration
## Last commit: 2011-06-23 16:19:34 UTC by root
version 10.0R3.10;
system {
    host-name R2;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}                  
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.10.2/32;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.2/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.3.2/24;
            }
        }
    }
    em3 {          
        unit 0 {
            family inet {
                address 192.168.1.2/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.2/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.2;
    autonomous-system 65010;
}
protocols {
    bgp {
        group internal-peers {
            type internal;
            export export_bgp;
            neighbor 192.168.2.3;
        }
        group external-peers {
            type external;
            export export_bgp;
            neighbor 192.168.1.1 {
                peer-as 2222;
            }
        }
    }
    ospf {
        area 0.0.0.0 {
            interface em1.0;
            interface lo0.0;
            interface em0.0;
        }
    }
}
policy-options {
    policy-statement export_bgp {
        then accept;
    }


R3
root@R3# run show configuration
## Last commit: 2011-06-23 18:19:36 UTC by root
version 10.0R3.10;
system {
    host-name R3;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.13.1/32;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.3/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.4.3/24;
            }
        }
    }              
    em3 {
        unit 0 {
            family inet {
                address 192.168.5.3/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.3/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.3;
    autonomous-system 65010;
}
protocols {
    bgp {
        group internal-peers {
            type internal;
            cluster 10.10.10.3;
            neighbor 192.168.2.2;
            neighbor 192.168.5.4;
        }
        group R3-R6 {
            type internal;
            export export_bgp;
            cluster 10.10.10.36;
            neighbor 192.168.4.6;
        }
    }
    ospf {
        export export_bgp;
        area 0.0.0.0 {
            interface em1.0;
            interface em3.0;
            interface lo0.0;
            interface em0.0;
        }
    }
}
policy-options {
    policy-statement export_bgp {
        then accept;
    }
}

R4
root@R4# run show configuration
## Last commit: 2011-06-23 16:23:13 UTC by root
version 10.0R3.10;
system {
    host-name R4;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}                  
interfaces {       
    em0 {
        unit 0 {
            family inet {
                address 192.168.10.4/32;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.3.4/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.5.4/24;
            }
        }
    }
    lo0 {
        unit 0 {   
            family inet {
                address 1.1.1.4/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.4;
    autonomous-system 65010;
}
protocols {
    bgp {
        group internal-peers {
            type internal;
            neighbor 192.168.5.3;
        }
    }
    ospf {
        area 0.0.0.0 {
            interface em2.0;
            interface lo0.0;
            interface em0.0;
        }          
    }
}

R5
root@R5# run show configuration
## Last commit: 2011-06-23 17:59:52 UTC by root
version 10.0R3.10;
system {
    host-name R5;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.8.5/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.5/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.5;
    autonomous-system 3333;
}
protocols {
    bgp {          
        group external {
            type external;
            export export_bgp;
            peer-as 65010;
            neighbor 192.168.8.7;
        }
    }
}
policy-options {
    policy-statement export_bgp {
        then accept;
    }
}

R6
root@R6# run show configuration
## Last commit: 2011-06-23 18:17:11 UTC by root
version 10.0R3.10;
system {
    host-name R6;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.4.6/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.7.6/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.9.6/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.6/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.6;
    autonomous-system 65010;
}
protocols {
    bgp {
        export export;
        group R3-R6 {
            type internal;
            neighbor 192.168.4.3;
        }
        group internal-peers {
            type internal;
            cluster 10.10.10.6;
            neighbor 192.168.9.8;
            neighbor 192.168.7.7;
        }
    }
    rip {
        group test {
            export export;
            neighbor em3.0;
            neighbor em2.0;
            neighbor lo0.0;
        }
    }
}
policy-options {
    policy-statement export {
        then accept;
    }
}

R7
root@R7# run show configuration
## Last commit: 2011-06-23 18:12:57 UTC by root
version 10.0R3.10;
system {
    host-name R7;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.7.7/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.6.7/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.8.7/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.7/32;
            }
        }
    }
}
routing-options {
    router-id 1.1.1.7;
    autonomous-system 65010;
}
protocols {
    bgp {
        export export;
        group internal-peers {
            type internal;
            neighbor 192.168.7.6;
        }
        group external {
            type external;
            peer-as 3333;
            neighbor 192.168.8.5;
        }
    }
    rip {
        group test {
            neighbor em1.0;
            neighbor lo0.0;
        }
    }
}
policy-options {
    policy-statement export {
        then accept;
    }
}

R8
root@R8# run show configuration
## Last commit: 2011-06-23 18:06:28 UTC by root
version 10.0R3.10;
system {
    host-name R8;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.9.8/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.6.8/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.8/32;
            }
        }
    }              
}
routing-options {
    router-id 1.1.1.8;
    autonomous-system 65010;
}
protocols {
    bgp {
        export export;
        group internal-peers {
            type internal;
            neighbor 192.168.9.6;
        }
    }
    rip {
        group test {
            neighbor em1.0;
            neighbor lo0.0;
        }
    }
}
policy-options {
    policy-statement export {
        then accept;
    }
}

728x90

Problem

When you activate a configuration, you want to include a short message that describes the changes you made.

Solution

Include a comment when you activate the configuration:

        aviva@router1# commit comment "turned on telnet"



Discussion

It's good practice to include a short description of the changes you made to each version of a configuration file so you can keep a history of configuration changes. You do this by using the comment option with the commit command.

To track down what changed in the configuration and when, you can review the comments:

        aviva@router1> show system commit

        0   2005-03-31 20:26:16 UTC by aviva via cli

            turned on telnet

        1   2005-03-31 11:12:28 UTC by aviva via cli

            set host gildor facility-override local4

728x90

  

7.2.4 VRRP


VRRP는 RFC 2338에 선언되어있는 여러 라우터 그룹에 redundancy를 위한 프로토콜 입니다. 그룹 라우터 중에 하나의 라우터가 이더넷 프레임에 응답을 해야 하기 때문에 Virtual router를 만듭니다. 이더넷 프레임을 보낸 Device는 여러 라우터가 묶여있는 라우터그룹을 하나의 단일 라우터로 인식합니다. 이더넷 프레임에 응답하는 라우터를 Master router라고 하고 이외의 라우터들은 Master가 죽을때 까지 대기만 하게 됩니다. Master router가 Virtual IP Address를 가지고 자신이 죽을때까지 이더넷 프레임에 응답을 하게 됩니다. 마스터가 죽게되면 대기하고 있던 라우터들 중에 하나가 Master router 가 가지고 있던 Virtual IP Address를 넘겨받고 역할을 대신하게 됩니다.

다이나믹 라우팅 프로토롤을 사용하면 특정 라우터가 죽었을때 데이터를 우회해서 라우팅을합니다. 그러나 다이나믹 라우텅 프로토콜을 사용하지 않는 경우( 예 : static routing )에는 오로지 단일 default gateway를 가지므로 default gateway router가 죽을경우 문제가 발생합니다. 뿐만 아니라 다이나믹 라우팅 프로토콜을 사용한 경우에도 특정 라우터가 죽엇을 경우에 hold time, dead time 등이 만료되기 전까지 우회하지 못합니다.
VRRP는 primary가 죽었을때  수동으로 설정된 devices 들이 backup 라우터를 사용할 수 있게 해줍니다.



위 사진을 보면 뉴욕과 시카고 라우터는 192.168.30.1의 vritual router IP를 가지고 있고뉴욕이 virtual router의 master역할을 합니다. 만약 host들이 192.168.30.1의 default gateway가지고 있다면 뉴욕 라우터가 이더넷 프레임을 수신하고 포워딩 하게 됩니다. 만약 뉴욕 라우터가 죽는다면 시카고 라우터가 master역할을 대신하게 됩니다.

 

만약 모든 라우터들이 virtual address 를 소유할려고 한다면 어떻게 될까요? 다행이로 그럴일이 없습니다..;; VRRP는 state and election-process 프로토콜이기 때문입다. device의 상태가 up이든지 down이든지 상관없이 election process는 어떤 라우터가 virtual group에 응답할 master 라우터인지 선언해 놓습니다. priority는 어떤 라우터가 virtual router IP를 넘겨받을 master 라우터 인지 어떤 라우터가 backup라우터 인지 결정하도록 합니다.
Priority값의 범위는 0~255이고 가장 높은 Priority값을 가진 라우터가 master로 선발됩니다. 주니퍼 라우터의 default priority값은 100 으로 설정되어 있고 특정 라우터가 반드시 master라우터가 되어야 한다면 priority값을 255 로 설정해야 합니다. 

 

7.2.4.1 Balancing Bandwidth

redundancy뿐만 아니라 VRRP를 사용하는 또다른 이유는 부하분산 때문입니다. 만약 특정 호스트그룹이나 라우터그룹들이 각각 다른 default gateway를 사용한다면 부하분산을 시킬수는 있지만 컨피크 노가다가 필요하고 특정 라우터가 죽으면  그 라우터를  default gateway로 사용하는 device들은 네트워크 사용이 불가능 해집니다. 하지만 VRRP를 사용하면 이런 문제 없이 로드벨런싱이 가능합니다.

VRRP는 여러 그룹을 하나의 네트워크에 할당 할 수 있습니다. 그리하여 Virtual IP address별로 서로 다른 라우터를 default gateway로 사용 할 수 있습니다. 위의 그림에서 뉴욕라우터가 192.168.30.1의 마스터이면서 192.168.30.2의 backup라우터 이고 시카고는 이와 반대입니다.


서로 다른 priority로 multiple virtual IP address를 사용하려면 각각의 그룹들이 네트워크 인터페이스에 설정이 되어야 합니다. backup 라우터가 master 라우터가 죽은지 어떻게 알수 있을까요?
master라우터는 그룹안에 있는 다른 라우터들에게 자신의 상태정보를 1초마다 광고합니다. 광고하는 내용에는 group ID, virtual IP address, master의 priority, advertisement interval , authentication 정보 등이 포함되어 있습니다.  

device들은 네트워크 안에서 고유한 MAC address를 가지고 있기 때문에 서로 다른 라우터들이 virtual IP address에 응답하기 위하여  virtual MAC address 또한 필요하게 됩니다. virtual MAC addess의 범위는 00:00:5e:00:01:00~ ff (RFC 2338)이고 VRRP그룹이 생성될때 만들어집니다. vritual MAC address 마지막 부분의 ff는 10진수로 255 이고 VRRP group ID랑 메치가 됩니다. 이는 아주 중요한 사항인데 MAC filtering을 사용할 때 각각의 그룹의 virtual MAC address는 반드시 추가를 해주어야 합니다.

7.2.4.2 VRRP Configuration





Refer to Figure 7-8 as you read through the following configuration example.

반드시 VRRP그룹은 unit 0 에서 설정해야 합니다.

New York

interfaces {
    fe-0/0/1.0 {
        unit 0 {
            family inet {
                address 192.168.30.3/24 {
                    vrrp-group 10 {
                        virtual-address 192.168.30.1;
                        priority 110;
                    }
                    vrrp-group 20 {
                        virtual-address 192.168.30.2;
                        priority 90;
                    }
                }
            }
        }
    }
}

 

lab@newyork> show vrrp

Interface   Unit  Group  Type  Address          Int state    VR state   Timer

fe-0/0/1    0     10     lcl   192.168.30.3            up          master     A

0.620

                            vip  192.168.30.1

fe-0/0/1    0     20     lcl   192.168.30.3            up          master     A

0.290                        

                            vip  192.168.30.2

lab@newyork>


지금은 시카고라우터 설정을 하지 않는 상태이기 때문에 뉴욕 라우터가 두 그룹의 마스터가 되어있습니다.

    Note

no-preempt 옵션을 사용할 경우 마스터 라우터별로 그룹을 설정해야 합니다. 모든 그룹이 한 라우터에 한번에 설정이 된다면 첫번째 라우터가 모든 그룹에 마스터가 되기때문입니다. 만약 그룹안에 또 다른 라우터가 더 높은 priority값을 가지고 있다고 하더라도 master역할이 넘어가지 않습니다. 오로지 마스터 라우터가 죽었을 경우에만 마스터를 선출합니다. 위의 예제를 예로들면 뉴욕라우터의 VRRP 그룹 10 을 설정한 다음 시카고라우터의 그룹 20을 설정한 후 두 라우터의 backup 그룹을 설정해야 합니다.

 

시카고 라우터는 뉴욕라우터와 정 반대로 설정하면 됩니다.

 

Chicago

interfaces {
    fe-0/0/1.0 {
        unit 0 {
            family inet {
                address 192.168.30.4/24 {
                    vrrp-group 10 {
                        virtual-address 192.168.30.1;
                        priority 90;
                    }
                    vrrp-group 20 {
                        virtual-address 192.168.30.2;
                        priority 110;
                    }
                }
            }
        }
    }
}

 

lab@newyork> show vrrp

Interface   Unit  Group  Type  Address          Int state    VR state   Timer

fe-0/0/1    0      10       lcl    192.168.30.3         up        master     A

0.890

                              vip   192.168.30.1

fe-0/0/1    0      20      lcl    192.168.30.3          up       backup     D

2.768                       vip   192.168.30.2

                             mas  192.168.30.4 

뉴욕라우터를 다시 보면 시카고라우터가 그룹 20에 더 높은 priority가 설정되었으므로 뉴욕라우터의 그룹 20 상태가 backup으로 변경되어 있음을 확인 할 수 있습니다.

refer to Juniper Networks® Reference Guide: JUNOS™ Routing, Configuration, and Architecture

 

728x90

 


Area 0 : R3, R4
Area 1 : R1, R3
Area 2 : R2, R4
Area 3 : R3, R4, R5, R6
 

root@R1# run show configuration
## Last commit: 2011-05-30 10:27:15 UTC by root
version 10.0R3.10;
system {
    host-name R1;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.10.1/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.3.1/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.1/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.1 {
            stub default-metric 20; // default metric 값 20 으로 변경 0.0.0.0
            interface em2.0;
        }
    }
}

root@R2# run show configuration
## Last commit: 2011-05-27 11:41:31 UTC by root
version 10.0R3.10;
system {
    host-name R2;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em1 {
        unit 0 {
            family inet {
                address 192.168.20.4/32;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.8.2/24;
            }
        }
    }
    em3 {
        unit 0 {
            family inet {
                address 192.168.3.2/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.2/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.2 {
            stub default-metric 10 no-summaries;
            interface em2.0;
        }
    }
}

root@R3# run show configuration
## Last commit: 2011-05-30 10:28:45 UTC by root
version 10.0R3.10;
system {
    host-name R3;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.5.3/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.3/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.1.3/24;
            }
        }
    }              
    em3 {
        unit 0 {
            family inet {
                address 192.168.4.3/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.3/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.1 {
            stub default-metric 20;
            interface em2.0;
        }
        area 0.0.0.0 {
            interface em3.0;
            interface lo0.0;
        }
        area 0.0.0.3 {
            interface em1.0;
            interface em0.0;
        }
    }
}

root@R4# run show configuration
## Last commit: 2011-05-27 14:00:08 UTC by root
version 10.0R3.10;
system {
    host-name R4;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.6.4/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.9.4/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.8.4/24;
            }
        }
    }              
    em3 {
        unit 0 {
            family inet {
                address 192.168.4.4/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.4/32;
            }
        }
    }
}
protocols {
    ospf {
        area 0.0.0.0 {
            interface em3.0;
            interface lo0.0;
        }
        area 0.0.0.2 {
            stub default-metric 10 no-summaries;
            interface em2.0;
        }
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
        }
    }
}

root@R5# run show configuration
## Last commit: 2011-05-27 13:56:54 UTC by root
version 10.0R3.10;
system {
    host-name R5;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.6.5/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.2.5/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.7.5/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.5/32;
            }
        }
    }
}
routing-options {
    static {
        route 100.100.100.0/24 next-hop 192.168.7.6; // static 경로를 테이블에 올리기 위해 임으로 설정함.
    }
}
protocols {
    ospf {
        export redis_static;
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
            interface em2.0;
            interface lo0.0;
        }
    }              
}
policy-options {
    policy-statement redis_static {    //static경로를 ospf로 재분배 하는 정책
        from protocol static;
        then accept;
    }
}

root@R6# run show configuration
## Last commit: 2011-05-27 13:59:36 UTC by root
version 10.0R3.10;
system {
    host-name R6;
    root-authentication {
        encrypted-password "$1$Le7q3/yU$l2sBlzemteXJhXQBnqnFX."; ## SECRET-DATA
    }
    services {
        ssh {
            root-login allow;
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }              
}
interfaces {
    em0 {
        unit 0 {
            family inet {
                address 192.168.5.6/24;
            }
        }
    }
    em1 {
        unit 0 {
            family inet {
                address 192.168.9.6/24;
            }
        }
    }
    em2 {
        unit 0 {
            family inet {
                address 192.168.7.6/24;
            }
        }
    }              
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.6/32;
            }
        }
    }
}
routing-options {
    static {
        route 200.200.200.0/24 next-hop 192.168.7.5;
    }
}
protocols {
    ospf {
        export redis_static;
        area 0.0.0.3 {
            interface em0.0;
            interface em1.0;
            interface em2.0;
            interface lo0.0;
        }
    }              
}
policy-options {
    policy-statement redis_static {
        from protocol static;
        then accept;
    }
}

728x90
R1
----------------------------------------------------------------------------------------------------------------
routing-options {
    static {
        route 0.0.0.0/0 next-hop [ 192.168.1.3 192.168.4.2 ];  // 192.168.1.3 ->R2  192.168.4.2.->R3
    }
    forwarding-table {
        export loadbalance;
    }
}
policy-options {
    policy-statement loadbalance {
        then {
            load-balance per-packet; 
        }
    }
}
----------------------------------------------------------------------------------------------------------------

commit 완료 후  R2, R3 에서 tcpdump 명령어로 sequence number 확인

tcpdump 명령어---------------
root@R3> start shell
root@R3% tcpdump -l -i em2
------------------------------
R2_ tcpdump
11:42:01.239017  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 122, length 64
11:42:03.238959  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 124, length 64
11:42:04.239231  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 125, length 64
11:42:07.239038  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 128, length 64
11:42:10.238711  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 131, length 64
11:42:11.239002  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 132, length 64
11:42:13.238967  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 134, length 64
11:42:14.238755  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 135, length 64
11:42:17.238425  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 138, length 64
11:42:20.238648  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 141, length 64
11:42:21.238450  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 142, length 64

R3_ tcpdump
11:42:09.992713  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 123, length 64
11:42:12.995975  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 126, length 64
11:42:13.996726  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 127, length 64
11:42:15.998653  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 129, length 64
11:42:16.999949  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 130, length 64
11:42:20.002647  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 133, length 64
11:42:23.005435  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 136, length 64
11:42:24.006640  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 137, length 64
11:42:26.008672  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 139, length 64
11:42:27.009432  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 140, length 64
11:42:30.012188  In IP truncated-ip - 24 bytes missing! 1.1.1.1 > 1.1.1.3: ICMP echo request, id 13080, seq 143, length 64

728x90
aggregated route는 단일 route announcement 에 여러 ip 경로를 보내는 것을 말한다. 간단히 말해서 경로를 요약해서 광고하는 것 이다.
 


Chardonnay는 Shiraz와 연결되어있고 BGP를 이용해서 라우팅 정보를 광고해야 한다. 이를 해결하기 위해 multiple
methods를 사용할 수 있지만 우리는 Shiraz에게 요약된 경로를 보내고 싶다. 이 요약된 경로는 Merlot, Cabernet, Riesling과 연결된 모든 고객들의 경로를 포함하고 있을 것이다. 가장 정확한 요약정보는 192.168.0.0./17 이고 이런 설정이 active 되면 요약된 경로들은 BGP로 재분배 및 광고가  될 것이다.
 
Contributing Routes

라우팅테이블에 aggregate route를 만드는 핵심포인트는 하나 이상의 contributing route 가 있느냐 없느냐 이다.
contributing route는 요약된 경로보다 더 구체적이면서 라우팅 테이블에 active되어 있는 경로를 말한다.  위의 그림에서 192.168.16.0/24, 192.168.32.0/24, 192.168.48.0/24 는 aggregate route ( 192.168.0.0/17)의 contributing route 이다.

user@Chardonnay> show route protocol aggregate detail
inet.0: 23 destinations, 25 routes (23 active, 0 holddown, 0 hidden)
192.168.0.0/17 (1 entry, 1 announced)
*Aggregate Preference: 130
Next hop type: Reject
State: <Active Int Ext>
Age: 23
Task: Aggregate
Announcement bits (2): 0-KRT 5-Resolve inet.0
AS path: I (LocalAgg)
Flags: Depth: 0 Active
AS path list:
AS path: I Refcount: 3
Contributing Routes (3):
192.168.16.0/24 proto Static
192.168.32.0/24 proto Static
192.168.48.0/24 proto Static 

 show route 명령어에 detail 이나  extensive 옵션을 사용하면 모든  aggregated route들을 확인 할 수 있다.

Next-Hop Options

 라우팅테이블에 있는 모든 경로들은 반드시 next-hop 이 유효해야 한다. aggregated route도 예외는 아니다.  static route와는 달리 오로지 2가지 옵션만 사용이 가능하다.

 reject 
   null값으로 설정되어 있고, reject가 선언된 구문에 매치되면 패킷을 드랍하고  ICMP는 "목적지가 도달불가능" 이라고
   메시지를 되돌려보냅니다. 디폴트로 설정되어 있다.
 discard
   null값으로 설정되어 있고, discard가 선언된 구문에 매치되면 패킷을 드랍시킨다.

Aggregate Route Attributes

static route에서 보았던 많은 어트리뷰트들이 aggregate route에서 볼 수 있다. 이는 JUNOS의 특성이다. 어트리뷰트 옵션을 알아보자
routing-options {
   aggregate {
       defaults {
         aggregate-options;
       }
       route destination-prefix {
          policy policy-name;
          aggregate-options;
       }
   }
}

active 
    next-hop이 사용불가능할 경우 라우팅 테이블에서 해당경로를 제거합니다. 디폴트로 설정되어 있습니다.
as-path
    static route에 수동으로 AS path를 설정하는 옵션이고 BGP로 재분배할때 유용합니다. 
brief
   모든 BGP contributing경로의 AS path 중에 가장 긴 common sequence를 가진 경로만 aggregate로 전송한다.
community
   BGP community값을 경로에 할당한다. 또한 경로 재분배할때 유용하다.
full
   모든 BGP contributing 경로의 AS path의 AS값이 aggregate 에 포함된다  기본적으로 설정되어 있다.
metric
   preference값이 동일할때 라우팅엔진이 어떤 경로를 선택할지 결정하기 위해 metric 값을 할당하는 옵션 
 

Configuration Examples

[edit routing-options]
user@Chardonnay# set aggregate route 192.168/17

이렇게 설정 하면 요로케 보인다..

[edit routing-options]
user@Chardonnay# show
   aggregate {
      route 192.168.0.0/17;
   }

지금의 설정에서는  attribute가 설정되어 있지 않다. 기본적으로 aggregate route 가  inet.0 라우팅 테이블에 등록이 될려면 적어도 하나의 contributing route가 필요하다.

contributing route를 입력하자.

routing-options {
    static {
        route 192.168.16.0/24 next-hop 1.1.1.1;
        route 192.168.32.0/24 next-hop 1.1.1.1;
        route 192.168.48.0/24 next-hop 1.1.1.1;

확인해보자

user@Chardonnay> show route protocol aggregate detail
inet.0: 11 destinations, 26 routes (11 active, 0 holddown, 0 hidden)
192.168.0.0/17 (1 entry, 1 announced)
*Aggregate Preference: 130
Next hop type: Reject
State: <Active Int Ext>
Age: 3
Task: Aggregate
Announcement bits (2): 0-KRT 5-Resolve inet.0
AS path: I (LocalAgg)
Flags: Depth: 0 Active
AS path list:
AS path: I Refcount: 3
Contributing Routes (3):
192.168.16.0/24 proto Static
192.168.32.0/24 proto Static
192.168.48.0/24 proto Static

[edit]
root@R1# run show route
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.0.0/17     *[Aggregate/130] 00:37:48
                               Reject

3개의  static route가 하나의 aggregate로 묶였다.

aggregate에서 default next-hop이  reject 이다.


+ Recent posts