An apparatus for ultrafiltration of a patient, comprising: a cassette having four inlets/outlets (25a, 25b, 25c, 25d); an intermittent bag connected to an intermittent tube, which is connected to a second inlet/outlet of the cassette, wherein the intermittent tube comprises an intermittent valve; a patient connector and a patient tube for connection of the patient connector, to a first inlet/outlet of the cassette, wherein the patient connector is intended to be connected to a patient line for access to a peritoneal cavity of the patient comprising a peritoneal fluid; a flow pump arranged in said patient tube for removal of a portion of the peritoneal fluid from the peritoneal cavity to the intermittent bag when the intermittent valve is open, through a first flow path comprising: said patient connector, said patient tube, said flow pump, said first inlet/outlet of the cassette, said cassette, said second inlet/outlet of the cassette, said intermittent tube, said intermittent valve and for addition of said portion of peritoneal fluid in said intermittent bag to said peritoneal cavity when the intermittent valve is open, through a second flow path comprising: said intermittent bag, said intermittent tube, said intermittent valve, said second inlet/outlet of the cassette, said cassette, said first inlet/outlet of the cassette, said flow pump, said patient tube and said patient connector; a drain tube for connection of a drain bag to a third inlet/outlet of the cassette, wherein the drain tube comprises a drain valve; characterized by a glucose tube for connection of a glucose bag comprising glucose at a high concentration to a fourth inlet/outlet of the cassette, wherein the glucose tube comprises a glucose pump for metering of glucose to the cassette for dilution of the glucose in the portion of peritoneal fluid being added from the intermittent bag to the peritoneal cavity in said second flow path for keeping a concentration of glucose substantially constant in the peritoneal cavity; wherein said first flow path and said second flow path are identical and are arranged without any adsorbent material or dialyzer. a cassette having four inlets/outlets (25a, 25b, 25c, 25d); an intermittent bag connected to an intermittent tube, which is connected to a second inlet/outlet of the cassette, wherein the intermittent tube comprises an intermittent valve; a patient connector and a patient tube for connection of the patient connector, to a first inlet/outlet of the cassette, wherein the patient connector is intended to be connected to a patient line for access to a peritoneal cavity of the patient comprising a peritoneal fluid; a flow pump arranged in said patient tube for removal of a portion of the peritoneal fluid from the peritoneal cavity to the intermittent bag when the intermittent valve is open, through a first flow path comprising: said patient connector, said patient tube, said flow pump, said first inlet/outlet of the cassette, said cassette, said second inlet/outlet of the cassette, said intermittent tube, said intermittent valve and for addition of said portion of peritoneal fluid in said intermittent bag to said peritoneal cavity when the intermittent valve is open, through a second flow path comprising: said intermittent bag, said intermittent tube, said intermittent valve, said second inlet/outlet of the cassette, said cassette, said first inlet/outlet of the cassette, said flow pump, said patient tube and said patient connector; a drain tube for connection of a drain bag to a third inlet/outlet of the cassette, wherein the drain tube comprises a drain valve; characterized by a glucose tube for connection of a glucose bag comprising glucose at a high concentration to a fourth inlet/outlet of the cassette, wherein the glucose tube comprises a glucose pump for metering of glucose to the cassette for dilution of the glucose in the portion of peritoneal fluid being added from the intermittent bag to the peritoneal cavity in said second flow path for keeping a concentration of glucose substantially constant in the peritoneal cavity; wherein said first flow path and said second flow path are identical and are arranged without any adsorbent material or dialyzer.