How can i set a 100mbit limit to all IP's. For Example I have a Apache2 Server and i dont want that 1 ip address can download with a speed upto 1Gbits only with 100mbit/s. Also I want to prevent dos attacks with that, so how can i do it.
It's not possible to rate limiting by ip, you only have global rate limiting on in interface.
for your outbound traffic, you need to do it with your apache server directly.
for inbound traffic, they are no way to avoid ddos from your host. (as the attacker can flood your nic with udp flood, tcp syn,...). The only way is to have more bandwith than your attacker, or use some cloud/isp antiddos solution before ddos is reaching your network.