Infectious hematopoietic necrosis (IHN) is a major disease that limits the culture of rainbow trout. In practical production, it has been found that the temperature of the culture water is a crucial factor affecting its mortality. Currently, little is known about how temperature affects the immune response of rainbow trout gut microbiota and metabolites to IHNV. In this study, our main objective is to analyze the changes in gut microorganisms of rainbow trout (juvenile fish with a consistent genetic background) after 14 days of infection with IHNV (5 × 105 pfu/fish) at 12–13°C (C: injected with saline, A: injected with IHNV) and 16–17°C (D: injected with saline, B: injected with IHNV) using metagenomic and metabolomic analyses, and to screen for probiotics that are effective against IHNV. The results showed that infection with IHNV at 12–13°C caused Eukaryote loss. Compared to Group C, Group A showed a significant increase in harmful pathogens, such as Yersiniaceae, and a significant alteration of 4,087 gut metabolites. Compared to group D, group B showed a significant increase in the abundance of Streptococcaceae and Lactococcus lactis, along with significant changes in 4,259 intestinal metabolites. Compared with their respective groups, the levels of two immune-related metabolites, 1-Octadecanoyl-glycero-3-phosphoethanolamine and L-Glutamate, were significantly upregulated in groups A and B. Compared to group B, Group A showed significantly higher pathogenic bacteria including Aeromonas, Pseudomonas, and Yersiniaceae, while group B showed a significant increase in Streptococcaceae and Lactococcus lactis. Additionally, there were 4,018 significantly different metabolites between the two groups. Interestingly, 1-Octadecanoyl-sn-glycero-3-phosphoethanolamine and L-Glutamate were significantly higher in group A than in group B. Some of the different metabolites in C vs. A are correlated with Fomitopsis pinicola, while in D vs. B they were correlated with Lactococcus raffinolactis, and in A vs. B they were correlated with Hypsizygus marmoreus. This study exposed how rainbow trout gut microbiota and metabolites respond to IHNV at different temperatures, and screens beneficial bacteria with potential resistance to IHN, providing new insights and scientific basis for the prevention and treatment of IHN.