summaryrefslogtreecommitdiff
path: root/smoketest/configs/dialup-router-medium-vpn
blob: fb8ed2714c0b67c1225ee0adfec2005ae2e15a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
firewall {
    all-ping enable
    broadcast-ping disable
    config-trap disable
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    name test_tcp_flags {
        rule 1 {
            action drop
            protocol tcp
            tcp {
                flags SYN,ACK,!RST,!FIN
            }
        }
    }
    options {
        interface vtun0 {
            adjust-mss 1380
        }
        interface vtun1 {
            adjust-mss 1380
        }
        interface vtun2 {
            adjust-mss 1380
        }
        interface wg0 {
            adjust-mss 1380
        }
        interface wg1 {
            adjust-mss 1380
        }
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies disable
    twa-hazards-protection enable
}
high-availability {
    vrrp {
        group LAN {
            hello-source-address 192.168.0.250
            interface eth1
            peer-address 192.168.0.251
            priority 200
            virtual-address 192.168.0.1/24
            vrid 1
        }
        sync-group failover-group {
            member LAN
        }
    }
}
interfaces {
    ethernet eth0 {
        duplex auto
        mtu 9000
        offload-options {
            generic-receive on
            generic-segmentation on
            scatter-gather on
            tcp-segmentation on
        }
        pppoe 0 {
            default-route auto
            mtu 1500
            name-server auto
            password password
            traffic-policy {
                out shape-17mbit
            }
            user-id vyos
            password vyos
        }
        smp-affinity auto
        speed auto
    }
    ethernet eth1 {
        address 192.168.0.250/24
        duplex auto
        ip {
            source-validation strict
        }
        mtu 9000
        offload-options {
            generic-receive on
            generic-segmentation on
            scatter-gather on
            tcp-segmentation on
        }
        policy {
            route LAN-POLICY-BASED-ROUTING
            ipv6-route LAN6-POLICY-BASED-ROUTING
        }
        smp-affinity auto
        speed auto
        traffic-policy {
            out shape-94mbit
        }
    }
    loopback lo {
    }
    openvpn vtun0 {
        encryption aes256
        hash sha512
        ip {
            source-validation strict
        }
        keep-alive {
            failure-count 3
            interval 30
        }
        mode client
        openvpn-option "comp-lzo adaptive"
        openvpn-option fast-io
        openvpn-option persist-key
        openvpn-option "reneg-sec 86400"
        persistent-tunnel
        remote-host 192.0.2.10
        tls {
            ca-cert-file /config/auth/ovpn_test_chain.pem
            cert-file /config/auth/ovpn_test_server.pem
            key-file /config/auth/ovpn_test_server.key
            auth-file /config/auth/ovpn_test_tls_auth.key
        }
    }
    openvpn vtun1 {
        authentication {
            password vyos1
            username vyos1
        }
        encryption aes256
        hash sha1
        keep-alive {
            failure-count 3
            interval 30
        }
        mode client
        openvpn-option "comp-lzo adaptive"
        openvpn-option "tun-mtu 1500"
        openvpn-option "tun-mtu-extra 32"
        openvpn-option "mssfix 1300"
        openvpn-option persist-key
        openvpn-option "mute 10"
        openvpn-option route-nopull
        openvpn-option fast-io
        openvpn-option "reneg-sec 86400"
        persistent-tunnel
        protocol udp
        remote-host 01.foo.com
        remote-port 1194
        tls {
            ca-cert-file /config/auth/ovpn_test_chain.pem
            auth-file /config/auth/ovpn_test_tls_auth.key
        }
    }
    openvpn vtun2 {
        authentication {
            password vyos2
            username vyos2
        }
        disable
        encryption aes256
        hash sha512
        keep-alive {
            failure-count 3
            interval 30
        }
        mode client
        openvpn-option "tun-mtu 1500"
        openvpn-option "tun-mtu-extra 32"
        openvpn-option "mssfix 1300"
        openvpn-option persist-key
        openvpn-option "mute 10"
        openvpn-option route-nopull
        openvpn-option fast-io
        openvpn-option remote-random
        openvpn-option "reneg-sec 86400"
        persistent-tunnel
        protocol udp
        remote-host 01.myvpn.com
        remote-host 02.myvpn.com
        remote-host 03.myvpn.com
        remote-port 1194
        tls {
            ca-cert-file /config/auth/ovpn_test_ca.pem
            auth-file /config/auth/ovpn_test_tls_auth.key
        }
    }
    wireguard wg0 {
        address 192.168.10.1/24
        peer red {
            allowed-ips 192.168.10.4/32
            persistent-keepalive 20
            preshared-key CumyXX7osvUT9AwnS+m2TEfCaL0Ptc2LfuZ78Sujuk8=
            pubkey ALGWvMJCKpHF2tVH3hEIHqUe9iFfAmZATUUok/WQzks=
        }
        peer green {
            allowed-ips 192.168.10.21/32
            persistent-keepalive 25
            preshared-key LQ9qmlTh9G4nZu4UgElxRUwg7JB/qoV799aADJOijnY=
            pubkey 5iQUD3VoCDBTPXAPHOwUJ0p7xzKGHEY/wQmgvBVmaFI=
        }
        peer blue {
            allowed-ips 192.168.10.3/32
            persistent-keepalive 20
            preshared-key ztFDOY9UyaDvn8N3X97SFMDwIfv7EEfuUIPP2yab6UI=
            pubkey G4pZishpMRrLmd96Kr6V7LIuNGdcUb81gWaYZ+FWkG0=
        }
        peer pink {
            allowed-ips 192.168.10.14/32
            allowed-ips 192.168.10.16/32
            persistent-keepalive 25
            preshared-key Qi9Odyx0/5itLPN5C5bEy3uMX+tmdl15QbakxpKlWqQ=
            pubkey i4qNPmxyy9EETL4tIoZOLKJF4p7IlVmpAE15gglnAk4=
        }
        port 7777
    }
    wireguard wg1 {
        address 10.89.90.2/30
        peer sam {
            allowed-ips 10.1.1.0/24
            allowed-ips 10.89.90.1/32
            endpoint 192.0.2.45:1200
            persistent-keepalive 20
            preshared-key XpFtzx2Z+nR8pBv9/sSf7I94OkZkVYTz0AeU5Q/QQUE=
            pubkey v5zfKGvH6W/lfDXJ0en96lvKo1gfFxMUWxe02+Fj5BU=
        }
        port 7778
    }
}
nat {
    destination {
        rule 50 {
            destination {
                port 49371
            }
            inbound-interface pppoe0
            protocol tcp_udp
            translation {
                address 192.168.0.5
            }
        }
        rule 51 {
            destination {
                port 58050-58051
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 52 {
            destination {
                port 22067-22070
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 53 {
            destination {
                port 34342
            }
            inbound-interface pppoe0
            protocol tcp_udp
            translation {
                address 192.168.0.121
            }
        }
        rule 54 {
            destination {
                port 45459
            }
            inbound-interface pppoe0
            protocol tcp_udp
            translation {
                address 192.168.0.120
            }
        }
        rule 55 {
            destination {
                port 22
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 56 {
            destination {
                port 8920
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 60 {
            destination {
                port 80,443
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 70 {
            destination {
                port 5001
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 80 {
            destination {
                port 25
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.5
            }
        }
        rule 90 {
            destination {
                port 8123
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.7
            }
        }
        rule 91 {
            destination {
                port 1880
            }
            inbound-interface pppoe0
            protocol tcp
            translation {
                address 192.168.0.7
            }
        }
        rule 500 {
            destination {
                address !192.168.0.0/24
                port 53
            }
            inbound-interface eth1
            protocol tcp_udp
            source {
                address !192.168.0.1-192.168.0.5
            }
            translation {
                address 192.168.0.1
            }
        }
    }
    source {
        rule 1000 {
            outbound-interface pppoe0
            translation {
                address masquerade
            }
        }
        rule 2000 {
            outbound-interface vtun0
            source {
                address 192.168.0.0/16
            }
            translation {
                address masquerade
            }
        }
        rule 3000 {
            outbound-interface vtun1
            translation {
                address masquerade
            }
        }
    }
}
policy {
    ipv6-route LAN6-POLICY-BASED-ROUTING {
        rule 10 {
            destination {
            }
            disable
            set {
                table 10
            }
            source {
                address 2002::1
            }
        }
        rule 20 {
            destination {
            }
            set {
                table 100
            }
            source {
                address 2008::f
            }
        }
    }
    prefix-list user2-routes {
        rule 1 {
            action permit
            prefix 10.1.1.0/24
        }
    }
    prefix-list user1-routes {
        rule 1 {
            action permit
            prefix 192.168.0.0/24
        }
    }
    route LAN-POLICY-BASED-ROUTING {
        rule 10 {
            destination {
            }
            disable
            set {
                table 10
            }
            source {
                address 192.168.0.119/32
            }
        }
        rule 20 {
            destination {
            }
            set {
                table 100
            }
            source {
                address 192.168.0.240
            }
        }
    }
    route-map rm-static-to-bgp {
        rule 10 {
            action permit
            match {
                ip {
                    address {
                        prefix-list user1-routes
                    }
                }
            }
        }
        rule 100 {
            action deny
        }
    }
}
protocols {
    bgp 64590 {
        address-family {
            ipv4-unicast {
                redistribute {
                    connected {
                        route-map rm-static-to-bgp
                    }
                }
            }
        }
        neighbor 10.89.90.1 {
            address-family {
                ipv4-unicast {
                    nexthop-self
                    prefix-list {
                        export user1-routes
                        import user2-routes
                    }
                    soft-reconfiguration {
                        inbound
                    }
                }
            }
            password ericandre2020
            remote-as 64589
        }
        parameters {
            log-neighbor-changes
            router-id 10.89.90.2
        }
    }
    static {
        interface-route 100.64.160.23/32 {
            next-hop-interface pppoe0 {
            }
        }
        interface-route 100.64.165.25/32 {
            next-hop-interface pppoe0 {
            }
        }
        interface-route 100.64.165.26/32 {
            next-hop-interface pppoe0 {
            }
        }
        interface-route 100.64.198.0/24 {
            next-hop-interface vtun0 {
            }
        }
        table 10 {
            interface-route 0.0.0.0/0 {
                next-hop-interface vtun1 {
                }
            }
        }
        table 100 {
            route 0.0.0.0/0 {
                next-hop 192.168.10.5 {
                }
            }
        }
    }
}
service {
    conntrack-sync {
        accept-protocol tcp,udp,icmp
        disable-external-cache
        event-listen-queue-size 8
        expect-sync all
        failover-mechanism {
            vrrp {
                sync-group failover-group
            }
        }
        interface eth1 {
            peer 192.168.0.251
        }
        sync-queue-size 8
    }
    dhcp-server {
        shared-network-name LAN {
            authoritative
            subnet 192.168.0.0/24 {
                default-router 192.168.0.1
                dns-server 192.168.0.1
                domain-name vyos.net
                domain-search vyos.net
                failover {
                    local-address 192.168.0.250
                    name DHCP02
                    peer-address 192.168.0.251
                    status primary
                }
                lease 86400
                range LANDynamic {
                    start 192.168.0.200
                    stop 192.168.0.240
                }
                static-mapping IPTV {
                    ip-address 192.168.0.104
                    mac-address 00:50:01:31:b5:f6
                }
                static-mapping McPrintus {
                    ip-address 192.168.0.60
                    mac-address 00:50:01:58:ac:95
                    static-mapping-parameters "option domain-name-servers 192.168.0.6,192.168.0.17;"
                }
                static-mapping Audio {
                    ip-address 192.168.0.107
                    mac-address 00:50:01:dc:91:14
                }
                static-mapping Mobile01 {
                    ip-address 192.168.0.109
                    mac-address 00:50:01:bc:ac:51
                    static-mapping-parameters "option domain-name-servers 192.168.0.6,192.168.0.17;"
                }
                static-mapping sand {
                    ip-address 192.168.0.110
                    mac-address 00:50:01:af:c5:d2
                }
                static-mapping pearTV {
                    ip-address 192.168.0.101
                    mac-address 00:50:01:ba:62:79
                }
                static-mapping camera1 {
                    ip-address 192.168.0.11
                    mac-address 00:50:01:70:b9:4d
                    static-mapping-parameters "option domain-name-servers 192.168.0.6,192.168.0.17;"
                }
                static-mapping camera2 {
                    ip-address 192.168.0.12
                    mac-address 00:50:01:70:b7:4f
                    static-mapping-parameters "option domain-name-servers 192.168.0.6,192.168.0.17;"
                }
            }
        }
    }
    dns {
        forwarding {
            allow-from 192.168.0.0/16
            cache-size 8192
            dnssec off
            listen-address 192.168.0.1
            name-server 100.64.0.1
            name-server 100.64.0.2
        }
    }
    snmp {
        community AwesomeCommunity {
            authorization ro
            client 127.0.0.1
            network 192.168.0.0/24
        }
    }
    ssh {
        access-control {
            allow {
                user vyos
            }
        }
        client-keepalive-interval 60
        listen-address 192.168.0.1
        listen-address 192.168.10.1
        listen-address 192.168.0.250
    }
}
system {
    config-management {
        commit-revisions 100
    }
    console {
        device ttyS0 {
            speed 115200
        }
    }
    host-name vyos
    ip {
        arp {
            table-size 1024
        }
    }
    login {
        user vyos {
            authentication {
                encrypted-password $6$O5gJRlDYQpj$MtrCV9lxMnZPMbcxlU7.FI793MImNHznxGoMFgm3Q6QP3vfKJyOSRCt3Ka/GzFQyW1yZS4NS616NLHaIPPFHc0
                plaintext-password ""
            }
        }
    }
    name-server 192.168.0.1
    name-servers-dhcp pppoe0
    ntp {
        allow-clients {
            address 192.168.0.0/16
        }
        listen-address 192.168.0.1
        listen-address 192.168.0.250
        server nz.pool.ntp.org {
            prefer
        }
    }
    options {
        beep-if-fully-booted
        ctrl-alt-del-action ignore
        reboot-on-panic true
    }
    static-host-mapping {
        host-name host104.vyos.net {
            inet 192.168.0.104
        }
        host-name host60.vyos.net {
            inet 192.168.0.60
        }
        host-name host107.vyos.net {
            inet 192.168.0.107
        }
        host-name host109.vyos.net {
            inet 192.168.0.109
        }
    }
    sysctl {
        custom net.core.default_qdisc {
            value fq
        }
        custom net.ipv4.tcp_congestion_control {
            value bbr
        }
    }
    syslog {
        global {
            facility all {
                level info
            }
        }
        host 192.168.0.252 {
            facility all {
                level debug
                protocol udp
            }
        }
    }
    task-scheduler {
        task Update-Blacklists {
            executable {
                path /config/scripts/vyos-foo-update.script
            }
            interval 3h
        }
    }
    time-zone Pacific/Auckland
}
traffic-policy {
    shaper shape-17mbit {
        bandwidth 17mbit
        default {
            bandwidth 100%
            burst 15k
            queue-type fq-codel
        }
    }
    shaper shape-94mbit {
        bandwidth 94mbit
        default {
            bandwidth 100%
            burst 15k
            queue-type fq-codel
        }
    }
}
/* Warning: Do not remove the following line. */
/* === vyatta-config-version: "broadcast-relay@1:cluster@1:config-management@1:conntrack-sync@1:conntrack@1:dhcp-relay@2:dhcp-server@5:dns-forwarding@1:firewall@5:ipsec@5:l2tp@1:mdns@1:nat@4:ntp@1:pptp@1:qos@1:quagga@6:snmp@1:ssh@1:system@9:vrrp@2:wanloadbalance@3:webgui@1:webproxy@1:webproxy@2:zone-policy@1" === */
/* Release version: 1.2.6 */