# Network

# iWay

Recently we where connected by [swl](https://www.swl.ch) to the fiber network and I switched from [upc](https://www.upc.ch), finally getting rid of the enforced router, finally the aera of synchonous connectivity started. 
## SG300-10
[![sg300](https://naumann.dev/uploads/images/gallery/2019-12/scaled-1680-/IMG_20191218_055354.jpg)](https://naumann.dev/uploads/images/gallery/2019-12/IMG_20191218_055354.jpg)
The setup is refreshingly simple, I added an SFP modul (FLEXOPTIX S.B1312.10.XDL) to the Cisco SG300-10 switch I used before, that was all. With my new provider [iWay](https://www.iway.ch) it was not even necessary to configure a specific VLAN. 

On there [website](https://kb.iway.ch/pages/viewpage.action?pageId=12256645) they say you need a `Simplex TX 1310nm/RX 1490nm BiBi SFP` Module.

The SFP module is connected to port 9 on the switch, port 10 goes to my [OPNsense](https://opnsense.org/) router. 
Ports 9 and 10 are on the same VLAN, just via access ports to separate the traffic. 
[![sg300 vlans](https://naumann.dev/uploads/images/gallery/2019-12/scaled-1680-/Screenshot-from-2019-12-18-06-16-58.png)](https://naumann.dev/uploads/images/gallery/2019-12/Screenshot-from-2019-12-18-06-16-58.png)
Port 8 gets internet from the router and distributes it to port 4, my office switch.
## OPNsense WAN
This is the WAN configuration I use
[![WAN](https://naumann.dev/uploads/images/gallery/2019-12/scaled-1680-/Screenshot_2019-12-18-[WAN]-Interfaces-open01-home.png)](https://naumann.dev/uploads/images/gallery/2019-12/Screenshot_2019-12-18-[WAN]-Interfaces-open01-home.png)

# t-online

This is about connecting the Draytec Vigor 165 as simple Modem to a VDSL2 t-online connection in Germany

# setup

[![installation](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/IMG_20200222_102700.jpg)](https://naumann.dev/uploads/images/gallery/2020-04/IMG_20200222_102700.jpg)

I am using the following hardware for this setup

* 1 DrayTek Vigor 165 as VDSL2 Modem (250/40 Connection)
* 1 apu3c4 (black) as OPNsense router (VLAN WIFI LAN)
* 1 apu3c4 (red) as docker host (LAN) with a 1TB SATA SSD inside
* 1 Cisco SG 200-8

# DrayTec Vigor 165

I did configure the DrayTec Vigor 165 as a Modem with t-online.

I use the following settings

[![General Setup](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/General_Setup.png)](https://naumann.dev/uploads/images/gallery/2020-04/General_Setup.png)
[![PPPoE](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/PPPoE.png)](https://naumann.dev/uploads/images/gallery/2020-04/PPPoE.png)
[![MPoA](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/MPoA.png)](https://naumann.dev/uploads/images/gallery/2020-04/MPoA.png)
[![MultiPVC](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/MultiPVC.png)](https://naumann.dev/uploads/images/gallery/2020-04/MultiPVC.png)
[![LAN](https://naumann.dev/uploads/images/gallery/2020-04/scaled-1680-/LAN-General.png)](https://naumann.dev/uploads/images/gallery/2020-04/LAN-General.png)

# docker

To be able to reach the DrayTec Vigor 165 admin page from other vlans I added a route to traefik.

This is my `/etc/environment` file

```bash
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
PUID=1001
PGID=1001
TZ="Europe/Zurich"
DOMAINNAME="apu07.home"
DNS=10.51.0.254
```

This is my `docker-compose.yml` file

```bash
version: '3.7'
  
services:
  traefik:
    container_name: traefik
    domainname: ${DOMAINNAME}
    image: traefik
    restart: unless-stopped
    command:
      - --api.insecure=true
      - --providers.docker
      - --providers.docker.exposedbydefault=false
      - --entrypoints.web.address=:80
      - --providers.file.directory=/rules
      - --providers.file.watch=true
      #- --providers.docker.defaultRule="Host(`${DOMAINNAME}`)"
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik/rules:/rules
    networks:
      - default
      - discovery
    dns:
      - ${DNS}

networks:
  discovery:
```
And I have traefik rules in a `traefik/rules/vigor.toml` file for the DrayTec Vigor 165
```bash
[http.routers]
  [http.routers.vigor-rtr]
      entryPoints = ["web"]
      rule = "Host(`vigor.apu07.home`)"
      service = "vigor-svc"

[http.services]
  [http.services.vigor-svc]
    [http.services.vigor-svc.loadBalancer]
      passHostHeader = true
      [[http.services.vigor-svc.loadBalancer.servers]]
        url = "http://10.51.0.1:80" 
```