发新话题
打印

[技术分享] Juniper静态路由基本配置!

Juniper静态路由基本配置!

root@netDorker# show
version 7.4R1.7;
system {
    host-name netDorker;
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
logical-routers {
    r1 {
        interfaces {
            fxp1 {
                unit 11 {
                    vlan-id 11;
                    family inet {
                        address 133.10.12.1/24;
                    }
                }
            }
            lo0 {
                unit 1 {
                    family inet {
                        address 133.10.1.1/32;
                    }
                }
            }
        }
        routing-options {
            static {
                route 0.0.0.0/0 next-hop 133.10.12.2;
            }
        }
    }
    r2 {
        interfaces {
            fxp2 {
                unit 11 {
                    vlan-id 11;
                    family inet {
                        address 133.10.12.2/24;
                    }
                }
            }
            lo0 {
                unit 2 {
                    family inet {
                        address 133.10.2.2/32;
                    }
                }
            }
        }
        routing-options {
            static {
                route 0.0.0.0/0 next-hop 133.10.12.1;
            }
        }
    }
}
interfaces {
    fxp0 {
        unit 0 {
            family inet {
                address 192.168.0.116/24;
            }
        }
    }
    fxp1 {
        vlan-tagging;
    }
    fxp2 {
        vlan-tagging;
    }
    fxp3 {
        vlan-tagging;
    }
}

[edit]
root@netDorker#

验证:
root@netDorker# run show route logical-router r1

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:02:15
                    > to 133.10.12.2 via fxp1.11
133.10.1.1/32      *[Direct/0] 00:05:31
                    > via lo0.1
133.10.12.0/24     *[Direct/0] 00:05:32
                    > via fxp1.11
133.10.12.1/32     *[Local/0] 00:05:32
                      Local via fxp1.11

[edit]
root@netDorker# run show route logical-router r2

inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 00:02:43
                    > to 133.10.12.1 via fxp2.11
133.10.2.2/32      *[Direct/0] 00:05:59
                    > via lo0.2
133.10.12.0/24     *[Direct/0] 00:05:59
                    > via fxp2.11
133.10.12.2/32     *[Local/0] 00:05:59
                      Local via fxp2.11

[edit]
root@netDorker# run ping 133.10.2.2 source 133.10.1.1 logical-router r1
PING 133.10.2.2 (133.10.2.2): 56 data bytes
64 bytes from 133.10.2.2: icmp_seq=0 ttl=64 time=1.654 ms
64 bytes from 133.10.2.2: icmp_seq=1 ttl=64 time=1.168 ms
^C
--- 133.10.2.2 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.168/1.411/1.654/0.243 ms

[edit]
root@netDorker# run ping 133.10.1.1 source 133.10.2.2 logical-router r2
PING 133.10.1.1 (133.10.1.1): 56 data bytes
64 bytes from 133.10.1.1: icmp_seq=0 ttl=64 time=4.330 ms
64 bytes from 133.10.1.1: icmp_seq=1 ttl=64 time=2.129 ms
^C
--- 133.10.1.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.129/3.229/4.330/1.101 ms

[edit]
root@netDorker#
=================================================================
结论:
     简单的静态路由,配置成功。哈哈

TOP

发新话题