Corporate VPN in Spain: a gateway for a Madrid office and the remote work rules
A Spanish server as a corporate VPN gateway suits a company with an office, a shop or a team in Spain and Portugal. A gateway in Madrid gives the whole peninsula a fast connection, and Spanish remote work laws bear directly on how you keep the connection log. Below is what to expect on latency, how traffic allowances on cheap plans work out, what the right to disconnect means, and how to connect an office that has the ISP's router.
Madrid, Barcelona and the islands
Most data centres are in Madrid, with Barcelona as the second location. Staff anywhere in mainland Spain see 5 to 15 ms to a Madrid gateway, and Lisbon and Porto come in at around 10 to 15 ms. The Canary Islands are further away, usually 30 to 40 ms, which is still enough for a remote desktop. From London and Frankfurt it is about 25 to 35 ms to Madrid, and from New York around 80 to 95 ms. Colleagues in Western Europe can use the Spanish gateway comfortably; a team in North America is better off with its own gateway closer to home. The locations are covered in more detail on VPS in Spain and VPS in Madrid.
The traffic allowance on cheap plans
Low-cost Spanish plans often come with a very small traffic allowance: from half a terabyte to just over a terabyte. That is enough for a website, but tight for a company gateway. Say you have an office of 25 people, and shared folders and the accounting system go through the tunnel: 1.5 GB per person per day comes to about 800 GB a month. Add video calls, if they run through the tunnel, and you will use up a 1 TB allowance by the third week. What happens next is in the plan terms: usually the speed is cut to 10 Mbit/s or every extra terabyte is billed.
So for a gateway take unmetered traffic or an allowance of 2 to 3 TB or more, and keep video calls outside the tunnel. While you are at it, check that the plan comes with its own IPv4: some Spanish offers do not, and without a fixed address the office router and laptops cannot connect reliably.
An office with the ISP's router
Many Spanish offices are connected to fibre through a router supplied by the ISP. It can usually share the connection and open ports, but you cannot set up a tunnel to your own server on it. There are two workable options. The first is to put your own router with WireGuard or IPsec support behind the ISP's one, for example a MikroTik; this setup is described on VPS for MikroTik. The second is a small computer in the office that keeps the tunnel up and routes the office subnet through it. In both cases the office initiates the connection, so you do not need to open any inbound ports on the ISP's router.
For remote staff laptops WireGuard is the simplest option. As for resources, up to 20 people fit on 1 core and 1 GB of memory; for 30 to 80 people, or OpenVPN with a second factor, take 2 cores and 2 GB.
The right to disconnect and the remote work law
Article 88 of the Spanish data protection law (LOPDGDD) establishes employees' right to digital disconnection: outside working hours they are not obliged to answer messages or log in to systems. The company has to describe this in an internal policy. Article 87 requires the employer to draw up the rules for using work devices with the involvement of employee representatives. A VPN log shows who logged in to the network in the evening and at weekends, and this is where it is easy to go wrong: such records must not be used to assess a person's performance. State in your policy that the log is there for security, who may open it and how long it is kept, for example 90 days.
The Remote Work Act 10/2021 requires a written agreement with any employee who regularly works from home. The agreement lists the equipment and tools the company provides. It is convenient to include access to the corporate network there too: the VPN key is issued for the work laptop and revoked when the laptop is returned. Supervision is carried out by the AEPD, and under GDPR you sign a data processing agreement with the hosting provider.
Backup and keys
Keep the second gateway in another country, for example in France: it is about 15 to 25 ms from Madrid, and an outage at a Spanish data centre will not affect it. Put both addresses into the office router and the laptops in advance. Every employee gets their own key, and when someone leaves it is removed the same day on both servers. Administrators log in with SSH keys and a second factor, and updates are installed on the gateways as soon as they come out.