This is a long journey that will take most of 2 days so I’d go further than Paris on Day 1. There are 2 main routes, either via Montpellier or via Hendaye. Depending on exact dates you could catch a night train from Paris to the Spanish border (i.e Cerbère).
Most Spanish trains for June have not been released yet so I use today’s timetable.
For example this itinerary gets you in Salamanca early:
DAY 1:
- ICE Hamburg Hbf - Frankfurt (Main) Hbf 06:23 - 09:56
- ICE Frankfurt (Main) Hbf - Paris-Est 11:01 - 14:51
- transfer though Paris
- TGV Paris-Montparnasse - Hendaye 16:09 - 20:48
- Euskotren Hendaye - San Sebastian (Interrail not valid, very cheap)
DAY 2:
- ARC San Sebastian - Valladolid Campo Grande 08:40 - 12:43
- MD Valladolid Campo Grande - Salamanca 14:08 - 15:42 (train continues to Salamanca La Alamedilla if that’s helpful)
You could also have a longer break in Paris, take the last TGV to Hendaye and sleep there. Then 11:30 from San Sebastian, change in Vitoria/Gasteiz, arrival 18:06.
Itinerary 2:
DAY 1:
- ICE Hamburg Hbf - Frankfurt (Main) Hbf 08:29 - 12:14 (or 1h later)
- TGV Frankfurt (Main) Hbf - Avignon TGV 14:02 - 21:09
DAY 2:
- AVE Avignon TGV - Madrid-Puerta de Atocha 08:40 - 15:52
- transfer to Chamartin
- ARC Madrid-Chamartin - Salamanca 21:11 - 22:51
Madrid - Salamanca has 4 direct trains a day as far as I can see, other options via Valladolid.
Check all these timetables closer to your trip. There might be changes, especially considering the recent incidents in Spain.