Can anyone suggest how to connect a CAT6 cable to the incoming 5 pair telephone cable?
Each of the incoming pairs in the telco's 5-pair cable is for a separate analog telephone line (or, in today's world, a single DSL channel). The pairs are identified by color: there's a solid blue wire paired with a white wire with blue stripe (also called tracer); a solid orange wire paired with a white wire with orange stripe, and so on with green, brown, and gray (slate).
The drop cable includes several pairs in case a subscriber might have wanted ability to make a voice call on one line while also using a modem or fax machine on another line. Sometimes pairs &quot;go bad&quot; due to cable damage, water ingress in the cable, etc so the extra pairs also provide some redundancy against that possibility.
I'd connect the blue pair of the CAT6 to whichever of the telco pairs has your primary telephone line, the orange pair to the second line, and so on. If you have only one line then connect only the blue pair from the CAT6.
As for mechanically how to carry out the connection: you need a &quot;punch down tool.&quot; These look like 110-style terminals. A professional tool is spring-loaded, trims wires to length, and does other neat things. But you can get a simple inexpensive plastic tool as well -- these are sometimes included with CAT5/CAT6/telephone &quot;keystone&quot; wall plate jacks. If you're careful and attentive, you could even get the wire pushed down into the terminal using a pair of small flat-blade screwdrivers.
Here are a few examples of 110 punch down tools:



Interior wiring is a common source of trouble especially for DSL services. The cable shown in your photo is basic 4-conductor. Twisted pair CAT-rated cable tends to perform better. CAT6 is significantly over-qualified for the application (CAT5e, CAT5, even CAT3 would do) but it is commonly available and there's no appreciable difference in price vs the lesser cables.
The technician might also have recommended replacement for another reason: the home's existing phone wire might run all throughout the house, have many junctions that could be problematic, etc. A new cable that goes directly between the phone demarcation point outside to your DSL modem will eliminate those variables.
With possibility of trouble in your inside wiring eliminated, if the low speed persists the DSL provider may be more willing to troubleshoot their network to search for connection problems.
It's worth confirming whether your service is two-pair bonded or single-pair, and if bonded which one is the second pair. A bonded service with only one pair connected would get half the throughput.
The modem has a WAN port probably because it is designed to work with both xDSL and another service like fiber to the home. In the latter, some providers install a box called ONU/ONT (optical network unit/terminator) to convert from optical fiber to Ethernet. That Ethernet would connect to the WAN port of a gateway device like yours.