|
发表于 2008-2-3 07:06:35
|
显示全部楼层
回复 16# 的帖子
专卖精品的,还不是来自这里,大家多看看官网的论坛吧。肯定有收获。。
dannyboy Post subject: WHAT IS WRONG WITH THIS CODE~~Posted: Mon Sep 11, 2006 3:43 am
Frequent Visitor
Joined: Fri Sep 16, 2005 3:21 am
Posts: 90
Location: Nicaragua Hello,
I copy and paste the code to do load balance from the wiki. I than changed ip address with mine. I have problems!!
First problem I have is that in src-nat I only see the nat rule for "Odd" having traffic, the "even" stays in 0 traffic.
Second problem I have is that once I setup my pppoe server, pppoe pool, Clients, ect, and connect, I cant surf at all.
Here is the code:
ip firewall mangle add chain=prerouting src-address-list=odd in-interface=Local action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting src-address-list=odd in-interface=Local action=mark-routing new-routing-mark=odd
add chain=prerouting src-address-list=even in-interface=Local action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting src-address-list=even in-interface=Local action=mark-routing new-routing-mark=even
add chain=prerouting in-interface=Local connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Local action=add-src-to-address-list address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes
add chain=prerouting in-interface=Local connection-mark=odd action=mark-routing new-routing-mark=odd passthrough=no
add chain=prerouting in-interface=Local connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=even passthrough=yes
add chain=prerouting in-interface=Local action=add-src-to-address-list address-list=even address-list-timeout=1d connection-mark=even passthrough=yes
add chain=prerouting in-interface=Local connection-mark=even action=mark-routing new-routing-mark=even passthrough=no
ip firewall nat add chain=srcnat connection-mark=odd action=src-nat to-addresses=165.98.168.4 to-ports=0-65535
ip firewall nat add chain=srcnat connection-mark=even action=src-nat to-addresses=165.98.144.47 to-ports=0-65535
ip route add dst-address=0.0.0.0/0 gateway=165.98.168.1 scope=255 target-scope=10 routing-mark=odd
ip route add dst-address=0.0.0.0/0 gateway=165.98.144.1 scope=255 target-scope=10 routing-mark=even
ip route add dst-address=0.0.0.0/0 gateway=165.98.144.1 scope=255 target-scope=10
Thanks
Top
Stryker777 Post subject: Posted: Mon Sep 11, 2006 3:54 am
Frequent Visitor
Joined: Fri Jul 07, 2006 10:40 pm
Posts: 67 As soon as you turn on PPPoE your "in interface" no longer is valid because your users are coming in via their dynamic interface that PPPoE creates.
Top
dannyboy Post subject: Posted: Mon Sep 11, 2006 4:01 am
Frequent Visitor
Joined: Fri Sep 16, 2005 3:21 am
Posts: 90
Location: Nicaragua thank you for your prompt response, so I cant use load balance using PPPOE? Also did you take a lool at the code, did I do something wrong? Why the srcnat only works with the odd packets not the even?
thanks again
Top
Stryker777 Post subject: Posted: Mon Sep 11, 2006 4:17 am
Frequent Visitor
Joined: Fri Jul 07, 2006 10:40 pm
Posts: 67 Are both address lists populating?
Are they populating with the same ips?
Top
inncom Post subject: Posted: Mon Sep 11, 2006 4:23 am
newbie
Joined: Wed Oct 12, 2005 12:17 pm
Posts: 31 Hmm, one thing i didnt find in this thread is the fact that you must not set default route, when using dhcp or such other meathods, kind of strange dont you think to have 2 default routes ?
Top
Stryker777 Post subject: Posted: Mon Sep 11, 2006 4:27 am
Frequent Visitor
Joined: Fri Jul 07, 2006 10:40 pm
Posts: 67 Code:
add chain=prerouting in-interface=Local action=add-src-to-address-list address-list=odd address-list-timeout=1d connection-mark=odd passthrough=yes
Everyone is being added to the odd address list.
Should look like this (needs to be changed on the even also):
Code:
add chain=prerouting in-interface=Local connection-mark=odd action=add-src-to-address-list address-list=odd address-list-timeout=1d passthrough=yes
That is all I see at this moment, Im very tired though lol.
Top
Stryker777 Post subject: Posted: Mon Sep 11, 2006 4:29 am
Frequent Visitor
Joined: Fri Jul 07, 2006 10:40 pm
Posts: 67 You set routes based on routing mark.
SInce everything should be marked even or odd those are the only 2 routes needed. They catch everything.
Top
Stryker777 Post subject: Posted: Mon Sep 11, 2006 4:32 am
Frequent Visitor
Joined: Fri Jul 07, 2006 10:40 pm
Posts: 67 One moe thing, you can still load balance with pppoe. You just cant use in interface. Instead use your address range (src address=) so it only deals with your local addresses.
Good night. |
|