作者: Gundamdriver 時間: 2009-1-24 10:32 標題: LAN ports load balancing
Hi. My server has got 2 LAN ports, and only one of them is being used only.
I wonder if it is possible to enable both LAN ports, and:
1. eth0 used for Internet connections,
2. eth1 used for intranet connections
So if the server want to download files (eg. BitTorrent, OS update), the system will use eth0; and if I connect to the server in the LAN (eg. Open files on Samba server, SSH connections), eth1 will be used.
Could someone suggest me some tutorials/ links/ articles? I am using Debian Lenny as my server OS. Thanks a lot.
作者: cmj 時間: 2009-1-24 10:49
都唔知你想點... 講緊 load balancing.... 又會一個lan一個wan.
作者: 有你便有我 時間: 2009-1-24 10:56
呢D叫load balancing嗎
eth0 set做gatewaydev
eth1 set 192.168.1.1/24(eg),個linux自動同你加條route.......
作者: Gundamdriver 時間: 2009-1-24 12:10 標題: 回覆 3# 的帖子
Oh, I don't know how to describe it... Sorry.
Thanks.
作者: 我係一舊雲 時間: 2009-1-25 15:16
原帖由 有你便有我 於 24-1-2009 10:56 發表
呢D叫load balancing嗎![]()
eth0 set做gatewaydev
eth1 set 192.168.1.1/24(eg),個linux自動同你加條route.......
一般人以為咁用就叫 load balancing, 因為並唔係一張 lan card 做
或者一般情形下,一張 lan card 可以同時出 intetnet , 又同時連到 intranet, 若分別連上其他電腦
若分開兩張 lan card 的話,感覺上未好似 load balancing 咁咯
不過若想 eth0 > internet , eth1 > intranet 的話,咁 eth0 正確係直接連線都 broadband modem, 咁先可以
否則 eth0 都諗住插落 router 的話,咁 eth0 , eth1 基本上係相同 subnet (eth0 > 192.168.1.10, eth1 > 192.168.1.11, 因為兩張 lan card 都插落 router 而被分配 ip address)
可是就只有插住 eth0 的電腦才可上網,作為 gateway, 而其他電腦則要在 default gateway 輸入 eth1 的 ip 才可以上網
若以為 eth0 , eth1 分別用於 internet / intranet, 以為有兩張 lan card 就可以的話,那是錯,基本任何 os 係做唔到, 因為那只是你個人覺得電腦會咁做, (因有兩張 lan card) 但實際上同插 router 的話,只會有一張 lan card 在運作
LINUX 以我所知係唔會自動加 link 落兩張 lan card 度
不同 lan card 各自插住不同 network, 基本上係可以,同時又可以不互通,並不等於插多了一張 lan card 就會自己互通的
中間要 add route / firewall 才可以的, 這時這部就已經變成 gateway / router 了
唔好一廂情願以為 linux 會有所謂自動, 只係自己以為 linux 會咁做, linux 就會自動做
如果我用同一部電腦 / server, 插上四張 lan card, 分別係連上公司四個不同部門, 若有所謂自動的話, 係唔係就等同四個部門都可以互相見到對方既電腦在相同的 network ? (相信都會諗到,要同 subnet + workgroup 先會見到) 咁點解插住兩張 lan card, 就會自動 add route 先???
[ 本帖最後由 我係一舊雲 於 2009-1-25 15:24 編輯 ]
作者: 有你便有我 時間: 2009-1-25 15:19
原帖由 我係一舊雲 於 2009-1-25 15:16 發表
一般人以為咁用就叫 load balancing, 因為並唔係一張 lan card 做
或者一般情形下,一張 lan card 可以同時出 intetnet , 又同時連到 intranet, 若分別連上其他電腦
若分開兩張 lan card 的話,感覺上未好似 load ba ...
唔會做唔到,set static route之嘛
作者: lazyfai 時間: 2009-1-25 17:07
如果佢部機唔係用黎做 router/gateway, 冇野要 set...
1. PPPoE (或者去 router, DHCP get IP from router ) 用 eth0
2. 另外 set 個 LAN IP 在 eth1 (eg. 192.168.1.xxx, 同 router IP range 不同即可 )
[ 本帖最後由 lazyfai 於 2009-1-25 17:08 編輯 ]
作者: 有你便有我 時間: 2009-1-25 21:23
唔好一廂情願以為 linux 會有所謂自動, 只係自己以為 linux 會咁做, linux 就會自動做
睇唔明你講乜,當個interface set左ip,eg:ifconfig eth0 192.168.10.1,再打route,就會睇到個linux自動加左條route
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
如果我用同一部電腦 / server, 插上四張 lan card, 分別係連上公司四個不同部門, 若有所謂自動的話, 係唔係就等同四個部門都可以互相見到對方既電腦在相同的 network ? (相信都會諗到,要同 subnet + workgroup 先會見到)
見唔到既係因為無開到packet forwarding,唔關route事,條route一樣自動有,echo "1" > /proc/sys/net/ipv4/ip_forward,打左呢句command個linux就會幫你forward packet啦。
如果你想唔同subnet一樣可以喺個網路上的芳鄰互相睇到既話可以set個wins server.......
作者: 我係一舊雲 時間: 2009-1-31 04:21
抱歉,當我唔識野算了
echo "1" > /proc/sys/net/ipv4/ip_forward
我所謂既自動,就係連 command 都唔需要先叫自動
電腦/os 係唔會代替你自動輸入需要既 command
唔打 command 就唔會做, 打左先會做
如果唔打 command 都得,係唔係咁先叫自動???
或者係 rc.local 當中加入,bootup 時就做左,係唔係咁先可稱為自動???
唔好意思,係我唔野
作者: lazyfai 時間: 2009-1-31 14:45
其實呢個 option 以前 default 係 1 的... 都算自動既.
後來為左 security 好多 Linux distributions 都“加”左 net.ipv4.ip_forward = 0 晌 /etc/sysctl.conf 先至變得唔自動。
原帖由 我係一舊雲 於 2009-1-31 04:21 發表
抱歉,當我唔識野算了
echo "1" > /proc/sys/net/ipv4/ip_forward
我所謂既自動,就係連 command 都唔需要先叫自動
電腦/os 係唔會代替你自動輸入需要既 command
唔打 command 就唔會做, 打左 ...
作者: wahli 時間: 2013-4-24 15:21
Anyone have some ideas.
I want to set 2 lan cards to increase the performance of my ubuntu server using samba service
I copy files from my windows 7 host PC to the ubuntu server
Now my speed only get around total 1X MB/S to copy about 400GB data
continous using 2 jobs from freefilesync to run together.
Each one about 5MB/S and it is very slow.
Please give some advice.Thanks.
作者: LoneGumMan 時間: 2013-4-24 16:09
本帖最後由 LoneGumMan 於 2013-4-24 16:10 編輯
你想做o既野叫做 teaming. 你需要 network card + switch support 先可以做到.
如果你就咁插兩張network card, 兩條線落同一個 switch , 唔得o既, 好彩o既係做唔到你想像中o既野, 唔好彩係個 server 駁唔到個network.
最簡單其實係幾舊水買個 gigabit router 加張 gigabit card. 唔駛乜野 jumbo frame 果d 都可以快好多. 不過如果你係用 SMB 黎 copy 野, 點都係慢 :(
作者: wahli 時間: 2013-4-25 09:33
本帖最後由 wahli 於 2013-4-25 09:39 編輯
I can see other people are having the same problem of slow samba speed. I have try using ssh to login the ubuntu server to transfer my data intead using samba. But the problem is SSH can't help me to sorting the data that I have already copy to the server. That mean I need to copy all the data once again all the time.
FreeFileSync have the function of compare the data that not copy to server. And will only copy the data that not on the server. That will more efficiency.
Or I better change other Linux version to improve the problems. Please advice. Thanks.
Out of topic,
Here is the youtube video that run a 4gbit ports lan card to improve the speed.
http://www.youtube.com/watch?v=ycbq_gTqT5M
Is it possible to do the same setting on Linux. Now I only want 2 LAN cards to improve my performance.
作者: hk-temp 時間: 2013-4-25 10:43
2009 年都推番上黎 @@
樓主問題仲未解決 !?


