It's not illegal, but you are liable for any wrongdoing done by people using your connection (Störerhaftung), especially with regard to unauthorized filesharing.
There was an amendment to the respective law to alleviate this problem and relieve providers of any liability, but the amendment was not phrased clear enough and there's a conflicting ruling from the European Court of Justice. In effect, if you are sued by rightholders for copyright violations committed through your connection, german courts decided, you are still liable unless you identify the perpetrator.