Xiangxiang's Personal Site

Machine Learning & Security Engineer
生命不息,折腾不止,留下一点活着的记录.

View on GitHub
31 December 2021

突破光猫千兆限制

by xiangxiang

要点

0 光猫

1 ER-12

firewall {
    all-ping enable
    broadcast-ping disable
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    name WAN_IN {
        default-action drop
        description "WAN to internal"
        rule 10 {
            action accept
            description "Allow established/related"
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            state {
                invalid enable
            }
        }
    }
    name WAN_LOCAL {
        default-action drop
        description "WAN to router"
        rule 10 {
            action accept
            description "Allow established/related"
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            description "Drop invalid state"
            state {
                invalid enable
            }
        }
    }
    options {
        mss-clamp {
            mss 1400
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
}
interfaces {
    bonding bond0 {
        description "Internet(PPPoE or DHCP)"
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
        }
        hash-policy layer2
        mode round-robin
        pppoe 0 {
            default-route auto
            firewall {
                in {
                    name WAN_IN
                }
                local {
                    name WAN_LOCAL
                }
            }
            mtu 1442
            name-server auto
            password ...
            user-id ...
        }
    }
    bonding bond2 {
        address 192.168.88.1/24
        description LAN
        hash-policy layer3+4
        mode 802.3ad
    }
    ethernet eth0 {
        bond-group bond0
        duplex auto
        speed auto
    }
    ethernet eth1 {
        bond-group bond0
        duplex auto
        speed auto
    }
    ethernet eth2 {
        bond-group bond0
        duplex auto
        speed auto
    }
    ethernet eth3 {
        bond-group bond0
        duplex auto
        speed auto
    }
    ethernet eth4 {
        bond-group bond2
        duplex auto
        speed auto
    }
    ethernet eth5 {
        bond-group bond2
        duplex auto
        speed auto
    }
    ethernet eth6 {
        bond-group bond2
        duplex auto
        speed auto
    }
    ethernet eth7 {
        bond-group bond2
        duplex auto
        speed auto
    }
    ethernet eth8 {
        duplex auto
        speed auto
    }
    ethernet eth9 {
        address 10.0.0.1/24
        duplex auto
        poe {
            output off
        }
        speed auto
    }
    ethernet eth10 {
        duplex auto
        speed auto
    }
    ethernet eth11 {
        duplex auto
        speed auto
    }
    loopback lo {
    }
    switch switch0 {
        mtu 1500
        switch-port {
            vlan-aware disable
        }
    }
}
port-forward {
    auto-firewall enable
    hairpin-nat enable
    lan-interface bond2
    rule 1 {
        ...
    }
    wan-interface pppoe0
}
protocols {
    static {
    }
}
service {
    dhcp-server {
        disabled false
        hostfile-update disable
        shared-network-name LAN1 {
            authoritative enable
            subnet 192.168.88.1/24 {
                ...
            }
        }
        static-arp disable
        use-dnsmasq enable
    }
    dns {
        dynamic {
            interface pppoe0 {
                ...
            }
        }
        forwarding {
            cache-size 10000
            listen-on bond2
            name-server 223.5.5.5
            name-server 119.29.29.29
            options no-resolv
            system
        }
    }
    nat {
        rule 5010 {
            description "masquerade for WAN"
            outbound-interface pppoe0
            type masquerade
        }
    }
    ssh {
        port 22
        protocol-version v2
    }
    ubnt-discover {
        disable
    }
    unms {
        ...
    }
}
system {
    analytics-handler {
        send-analytics-report false
    }
    crash-handler {
        send-crash-report false
    }
    host-name EdgeRouter-12
    ipv6 {
        disable
    }
    login {
        ...
    }
    name-server 223.5.5.5
    ntp {
        server 0.ubnt.pool.ntp.org {
        }
        server 1.ubnt.pool.ntp.org {
        }
        server 2.ubnt.pool.ntp.org {
        }
        server 3.ubnt.pool.ntp.org {
        }
    }
    offload {
        hwnat disable
        ipv4 {
            bonding enable
            forwarding enable
            gre enable
            pppoe enable
            vlan enable
        }
        ipv6 {
            bonding enable
            forwarding enable
            pppoe disable
        }
    }
    package {
        repository stretch {
            components "main contrib non-free"
            distribution stretch
            password ""
            url http://http.us.debian.org/debian
            username ""
        }
    }
    time-zone Asia/Shanghai
}

2 交换机配置

tags: 网络折腾 F1855v2 er12