route traffic of eth0 to eth1

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

route traffic of eth0 to eth1

Post by ghulam yaseen »

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:

Post by lambda »

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:

Post by x2oxen »

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

Post by ghulam yaseen »

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:

Post by lambda »

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:

Post by mejam »

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:

Post by lambda »

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:

Post by mejam »

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:

Post by LinuxFreaK »

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:

Post by ghulam yaseen »

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:

Post by ghulam yaseen »

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:

Post by lambda »

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"?
Post Reply