Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

There is a network 192.168.0.*

Users have IPs 192.168.0.100 - 192.168.0.200 Ubuntu server has IP 192.168.0.1

There are 3 ADSL modems at IPs 192.168.0.10, 192.168.0.11, 192.168.0.12

I'd like to make gateway at all user computers 192.168.0.1 (Ubuntu server) and server should do NAT according to rules:

  • source IP 192.168.0.100-192.168.0.132 --> 192.168.0.10 (Internet1)
  • source IP 192.168.0.133-192.168.0.166 --> 192.168.0.11 (Internet2)
  • source IP 192.168.0.167-192.168.0.200 --> 192.168.0.12 (Internet3)

I need that to:

  • calculate traffic by each user
  • easy modify routes without reconfiguring each computer
  • filter some bad sites

Is it possible?

share|improve this question

1 Answer 1

Yes, it can be done. Since you need source based routing. You cannot do it using simple route command. You would have to create multiple routing tables and create rules on which table should be used based on criteria (in your case source IP).

To learn about IP routing II you can refer to: http://lartc.org/howto/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.