You cannot consolidate both your federal or student loans together but you can refinance both student loan types through a private lender. This is called student loan refinancing. It is often called consolidation but in reality, you are refinancing both private and federal loans into a new private loan.
You can choose to consolidate your federal student loans under the federal program and refinance your private student loans through a private lender. When you refinance your federal and private student loans you are taking on a new loan and paying off the old loans.
The benefit of refinancing both federal and private student loans together is to make repayments easier through one single payment versus multiple. Additionally, refinancing federal and private loans into a new private loan may lower monthly payments, reduce interest rates and offer some additional benefits. Read the fine print and understand the new terms of the new private loan.