Configure a linux box as a gateway/router
Posted on 2005-03-07
We have at home a small LAN of 20 computers. All the computers have local IPs like 192.168.0.x. We also have internet through a fiber optic and a media convertor. The media convertor is connected to the linux box. The linux box is runnig RedHat 9.0 and has 2 network cards installed. One for the internet and one for the LAN. The ISP gave us 1 external IP for the linux box: 22.214.171.124 and a class of 16 external IPs for the computers that will be connected to the internet: 82.77.0.x. Not all the computers will be connected to the internet, just 6 of us want internet. We must confgure the linux box as a router/gateway and maybe as a DHCP server to provide external IPs to the 6 computers that will be connected to the internet and local IPs to the other computers. The selection could be made by the MAC address of each computer. The problem is that we want to keep our LAN and we want to be able to play games on LAN on all the computers in the LAN. So all the computers should be able to communicate with each other, but only 6 of them be able to access the internet using the external IPs provided by the ISP. We also want a script for the linux box to configure the intenet bandwitdh allowed by each computer separately. Example: 5 computers to have a maximum of 32 kb/s each and 1 computer only have a maximum of 4 kb/s. The bandwitdh must be allocated dynamicly to the computers. I mean the maximum speed of the internet in the server is 32 kb/s. If only one computer is surfing the internet he should be able to use all the bandwitdh of 32 kb/s. But if a second computer wants to surf the internet too, the bandwidth should be splited in 2, 16 kb for each computer and so on if another computer joins or leaves on the internet. If you don't understand something please ask me. Thank you very much for your help.