Juniper 静态路由

Juniper <wbr>静态路由

R1最后配置结果

root@R1# exit

[edit]
root@R1# show
## Last changed: 2012-05-22 06:42:46 UTC
version 11.1R1.14;
system {
    host-name R1;
    root-authentication {
        encrypted-password abc123,; ## SECRET-DATA
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            family inet {              
                address 172.16.1.1/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 1.1.1.1/32;
            }
        }
    }
}
routing-options {
    static {
        route 2.2.2.2/32 next-hop 172.16.1.2;
    }
}

[edit]

R2最后配置结果

root@R2# show
## Last changed: 2012-05-22 07:14:49 UTC
version 10.2R1.8;
system {
    host-name R2;
    root-authentication {
        encrypted-password abc123,; ## SECRET-DATA
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    em0 {
        unit 0 {
            family inet {              
                address 172.16.1.2/24;
            }
        }
    }
    lo0 {
        unit 0 {
            family inet {
                address 2.2.2.2/32;
            }
        }
    }
}
routing-options {
    static {
        route 1.1.1.0/24 next-hop 172.16.1.1;
    }
}

[edit]

配置过程

环境配置

root@R1> configure
Entering configuration mode

[edit]

root@R1# edit interfaces em0 unit 0 family inet address 172.16.1.1/24

root@R1# edit interfaces lo0 unit 0 family inet address 1.1.1.1/32

root# commit                                                  
commit complete


 

root@R2> configure
Entering configuration mode

[edit]

root@R2# edit interfaces em0 unit 0 family inet address 172.16.1.1/24

root@R2# edit interfaces lo0 unit 0 family inet address 1.1.1.1/32
root# commit                                                  
commit complete

静态路由的配置

root@R1# edit routing-options

[edit routing-options]

root@R1# set static route 2.2.2.2/32 next-hop 172.16.1.1 

root@R1# commit
commit complete

[edit routing-options]

root@R1# show                 
static {
    route 2.2.2.2/32 next-hop [ 172.16.1.2 ];
}

[edit routing-options]

root@R2# edit routing-options

[edit routing-options]
root@R2# set static route 1.1.1.1/32 next-hop 172.16.1.2

[edit routing-options]
root@R2# commit
commit complete

[edit routing-options]

root@R2# show
static {
    route 1.1.1.1/32 next-hop 172.16.1.1;
}

[edit routing-options]

 

测试

root@R1# run ping 2.2.2.2
PING 2.2.2.2 (2.2.2.2): 56 data bytes
64 bytes from 2.2.2.2: icmp_seq=0 ttl=64 time=4.489 ms

root@R2# run ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=64 time=6.830 ms


 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/houzhiqing/archive/2012/05/22/5289429.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值