www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

country ip classes to routing table

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> Networking
View previous topic :: View next topic  
Author Message
deejayq



Joined: 02 Feb 2010
Posts: 10

PostPosted: Wed Feb 17, 2010 10:02 am    Post subject: country ip classes to routing table Reply with quote

n00b question: is it possible to add all ip classes of a country to the routing table to be able to do bandwidth limiting per country?
thank you
Back to top
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Wed Feb 17, 2010 12:13 pm    Post subject: Reply with quote

I think not. Even if you could summarize the IPs of a country, it is not certain that it will stay the same for a long time.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
deejayq



Joined: 02 Feb 2010
Posts: 10

PostPosted: Thu Feb 18, 2010 8:01 am    Post subject: Reply with quote

i have the following configuration
Code:

                                                                   ________
                                                                  /
                                                                 /
                             +-------------------+              /
                             |                   |             /
                      +------+-------+    +------+-------+    /
+----------------+    |     vlan1    |    |     vlan1    |   /
|                |    |              |    |              |  |
| Local networks +----+   Zeroshell  |    |      ISP     +--+  Internet cloud
|                |    |              |    |              |  |
+----------------+    |     vlan2    |    |     vlan2    |   \
                      +------+-------+    +------+-------+    \
                             |                   |             \
                             +-------------------+              \
                                                                 \
                                                                  \________

on vlan1 is routed the traffic to romania
on vlan2 is routed all the other traffic
i use freebsd and i want to use zeroshell
i don't know how to push the traffic to romanian ip's thru vlan1

do you think that by using the following example will work?
Code:
echo 1 romania >> /etc/iproute2/rt_tables
ip route add default via x.x.x.x dev vlan1 table romania

ip rule add from a.a.a.a/24 table romania
ip rule add from b.b.b.b/24 table romania
...


where x.x.x.x is the gateway from my provider and a.a.a.a/24, b.b.b.b/24 etc are the ip classes from romania

thank you
Back to top
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Thu Feb 18, 2010 8:45 am    Post subject: Reply with quote

Well if you know the prefixes you can add them easily. Go to Network -> Router and Add a Static Route. Select a network with its mask and an interface instead of an IP.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
deejayq



Joined: 02 Feb 2010
Posts: 10

PostPosted: Thu Feb 18, 2010 10:48 am    Post subject: Reply with quote

so, it's better to use the "main" routing table instead of two routing tables

i thought that because of the two vlan ips with the same gateway i should have two routing tables

anyway, thanks for the quick reply

also, do you know how to make this changes permanent?
and what about performance? i want to add about 5000 static routes via dev vlan1
Back to top
View user's profile Send private message
ppalias



Joined: 17 Dec 2008
Posts: 1151
Location: Athens, Greece

PostPosted: Thu Feb 18, 2010 12:59 pm    Post subject: Reply with quote

Once changes are saved, they become permanent.
I don't think there will be a performance issue, however you could aggregate some /24 prefixes to /23 or /22
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
deejayq



Joined: 02 Feb 2010
Posts: 10

PostPosted: Fri Feb 19, 2010 6:25 am    Post subject: Reply with quote

where does zeroshell save the static routes? what file?
thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> Networking All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group