0

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?

luchaninov
  • 343
  • 1
  • 4
  • 11

1 Answers1

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/

Saurabh Barjatiya
  • 4,703
  • 2
  • 30
  • 34