route traffic of eth0 to eth1

Taking care of your Linux box.
ghulam yaseen
Naik
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

route traffic of eth0 to eth1

Postby ghulam yaseen » Fri Feb 20, 2009 1:20 pm

Hello All,

I am running a server on two ethernets which can be accessed in all over pakistan. Currently ethernet 0 is configured to entertain users of karachi and Lahore but i need to route users of lahore to ethernet 1 and users of karachi to ethernet0. I have already implemented the ip forward setup but yet no luck. Can any one help.

Regards,

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Fri Feb 20, 2009 5:06 pm

I am running a server on two ethernets which can be accessed in all over pakistan.
how do users get to your server?
Currently ethernet 0 is configured to entertain users of karachi and Lahore but i need to route users of lahore to ethernet 1 and users of karachi to ethernet0.
assuming you use bind for dns, give ethernet0 one ip address, ethernet1 another ip address, and use views in send traffic from different cities to different ips.
I have already implemented the ip forward setup but yet no luck.
forward from where to where?
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

x2oxen
Major General
Posts: 1114
Joined: Wed Aug 22, 2007 3:17 pm
Location: Faisalabad
Contact:

Postby x2oxen » Sat Feb 21, 2009 12:15 pm

And how you differentiating which user is from karachi and which is from Lahore??
Muhammad Usman
+92-321-6640501
Chemonics International
http://usmanpk.com

ghulam yaseen
Naik
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

Postby ghulam yaseen » Sun Feb 22, 2009 12:40 am

As i told you i have two ip's, one ip of karachi users and second ip of lahore so i want when ever lahore users click on my domain should go to lahore ip and karachi users when click should go to karachi ip. it is just 2 different ip's.
Further i can see on net that may be iptables can also do this work, further help will be appreciable.


Regards,


x2oxen wrote:And how you differentiating which user is from karachi and which is from Lahore??

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Sun Feb 22, 2009 2:56 am

As i told you i have two ip's, one ip of karachi users and second ip of lahore so i want when ever lahore users click on my domain should go to lahore ip and karachi users when click should go to karachi ip. it is just 2 different ip's.
so, it appears that in answer to x2oxen's question, you currently aren't differentiating between users from lahore and karachi.
Further i can see on net that may be iptables can also do this work, further help will be appreciable.
where did you see this? i don't think iptables can do it.

what you need is a list of networks that isps in lahore use, and a similar list for karachi. you can then use bind views (assuming you use bind for dns, and control the dns server) to direct traffic to whichever ip you want them to connect with.
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

mejam
Havaldaar
Posts: 127
Joined: Sat Oct 18, 2008 12:30 pm
Location: Lahore
Contact:

Postby mejam » Mon Feb 23, 2009 12:19 pm

Have anyone heard about Geo-targeting scripts......i think it is more easy to make this task possible than getting the IP lists of ISPs....
Regards
Abdulrehman

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Mon Feb 23, 2009 1:36 pm

geo-targeting scripts use ip address ranges! you can get the list of networks from a geo-targeting script (or site with lists of networks).
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

mejam
Havaldaar
Posts: 127
Joined: Sat Oct 18, 2008 12:30 pm
Location: Lahore
Contact:

Postby mejam » Mon Feb 23, 2009 1:44 pm

Yes it is and it will help him getting the lists very easily...... 8)
Regards

Abdulrehman

LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Postby LinuxFreaK » Mon Feb 23, 2009 1:45 pm

Dear Ghulam Yaseen,
Salam,

I think netfilter geoip patch will also help.

FYI, http://people.netfilter.org/~peejix/geo ... WTO-2.html

Best Regards.
Farrukh Ahmed

ghulam yaseen
Naik
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

Re:

Postby ghulam yaseen » Fri Feb 27, 2009 3:29 pm

Thanks, this works by your solution Farrukh bhai

LinuxFreaK wrote:Dear Ghulam Yaseen,
Salam,

I think netfilter geoip patch will also help.

FYI, http://people.netfilter.org/~peejix/geo ... WTO-2.html

Best Regards.

ghulam yaseen
Naik
Posts: 68
Joined: Thu Aug 07, 2008 6:09 pm
Location: karachi

Re:

Postby ghulam yaseen » Sat Mar 14, 2009 9:07 pm

This post is just for all users further knowldge that Netfilter is one way and the other way is using DNS round-robin to use two ip's for one domain for load balancing.

Regards,
ghulam yaseen wrote:Thanks, this works by your solution Farrukh bhai

LinuxFreaK wrote:Dear Ghulam Yaseen,
Salam,

I think netfilter geoip patch will also help.

FYI, http://people.netfilter.org/~peejix/geo ... WTO-2.html

Best Regards.

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Sat Mar 14, 2009 9:22 pm

again, look at bind views (tinydns has something similar). you can easily specify what your domain looks like to other people depending on their ip/network.

dns round-robin is something else (and note: doesn't work properly with vista).
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?


Return to “Administration”

Who is online

Users browsing this forum: No registered users and 3 guests