使用juniper SRX 配置双链路PPPoE实现冗余功能

 

这实验是本人家里的真实环境,由于当时己经有一条在用的电信宽带,且移动当时推送一条可以免费使用一年的家庭宽带正好可以用上,后来一年到期后就再也没使用了。。

有时候为了节省开支,又想实现链路冗余,可以上网淘一台二手设备来试试。本环境适用于小型企业或者家庭。


 

拓扑如下:

 

 

 SRX配置:

---------------------------------接口配置--------------------------------
interfaces {
    fe-0/0/2 {
        unit 0 {                        
            family inet {
                address 10.1.1.1/24;
            }
        }
    }
    fe-0/0/4 {
        unit 0 {
            encapsulation ppp-over-ether;
        }
    }
    fe-0/0/5 {
        unit 0 {
            encapsulation ppp-over-ether;
        }
    }
    pp0 {
        unit 0 {
            ppp-options {
                pap {
                    local-name "电信账号";
                    local-password "电信账号密码"; ## SECRET-DATA
                    passive;
                }
            }
            pppoe-options {
                underlying-interface fe-0/0/4.0;
                idle-timeout 0;
                auto-reconnect 3;
                client;
            }
            family inet {
                mtu 1492;
                negotiate-address;
            }
        }   
        unit 1 {
            ppp-options {
                pap {
                    local-name "移动账号";
                    local-password "移动账号密码"; ## SECRET-DATA
                    passive;
                }
            }
            pppoe-options {
                underlying-interface fe-0/0/5.0;
                idle-timeout 0;
                auto-reconnect 3;
                client;
            }
            family inet {
                mtu 1492;
                negotiate-address;
            }
        }
    }
---------------------------------路由配置--------------------------------
routing-options {
    static {
        route 0.0.0.0/0 {
            next-hop pp0.0;
            qualified-next-hop pp0.1;
           preference 10; }
        preference 5; } forwarding-table { export load-balance; } } policy-options { policy-statement load-balance { then { load-balance per-packet; } } } ---------------------------------NAT配置-------------------------------- security { nat { source { rule-set trust-to-untrust { from zone trust; to zone untrust; rule source-nat { match { source-address 0.0.0.0/0; } then { source-nat { interface; } } } } ---------------------------------策略配置-------------------------------- policies { from-zone trust to-zone untrust { policy Permit_Any { match { source-address any; destination-address any; application any; } then { permit; log { session-init; } } } ---------------------------------区域配置-------------------------------- zones { security-zone trust { host-inbound-traffic { system-services { all; } protocols { all; } } interfaces { fe-0/0/2.0; } } security-zone untrust { screen Untrust; host-inbound-traffic { system-services { all; } protocols { all; } } interfaces { pp0.0; pp0.1; } } }

有几点需要注意的:

1.PPPoE链路中,MTU最大为1492 Bytes

2.无线路由器只是作为中继,或者DHCP服务器,拔号是在SRX上进行拨号

 

3.拔号成功后,pppoe的接口会up,可以看到电信链路得到的是公网IP,而移动的IP是私网的

 

 

 

 检验:

 

 

 测试:

现在默认是走电信链路的,如果想要模拟切换的话需要把连接电信光猫的网线拨掉才切换到移动线路

默认情况:

 

切换后:

 

 


 

优化:

由于目前流量都是走一条链路的,可以根据目的地址做一下策略路由,使其一部分流量走电信,另一部分走移动,这样就可以实现负载均衡了

 

posted @ 2020-05-07 09:45  tim54252  阅读(1462)  评论(0编辑  收藏  举报