Saturday, June 14, 2008

在Linux下配置PPPoE联网-----适用于ADSL和长城宽带等

要在Linux下使用PPPOE认证方式,必须安装PPPOE客户端软件。下面说明如何进行安装:

本文以RedHat Linux 6.2为实验平台,其它平台的Linux安装办法可以参照下面从源代码进行安装的步骤。

一、安装的前提条件

1.确保安装了网卡并工作正常

使用命令

#ifconfig eth0

查看网卡状态

2.在系统中不要设置默认路由(网关),让ADSL拨号后自动获得

如果已经设置了默认路由,使用以下方法删除:
在文件 /etc/sysconfig/network 中删除 GATEWAY= 这一行,然后以root执行:

#/etc/rc.d/init.d/network restart

3.已经安装了pppd软件包

如果存在文件 /usr/sbin/pppd,则说明已经安装了pppd;
如果未安装,从RedHatLinux 6.2安装光盘上安装ppp-2.3.11-4.i386.rpm这个软件包

二、安装PPPOE客户端软件

Linux下的PPPOE客户端软件比较多,而且大多使用GNU License,我们推荐使用rp-pppoe这个软件包。从http://www.roaringpenguin.com/pppoe/这个网站上,不仅可以下载 RedHat 62平台下的rp-pppoe的二进制软件包,而且可以下载源代码软件包。

1.二进制软件包的安装:
A.下载二进制软件包
http://www.roaringpenguin.com/pppoe/rp-pppoe-3.2-1.i386.rpm

B.进行安装

以root执行:
#rpm -Uvh rp-pppoe-3.2-1.i386.rpm

2.从源代码进行安装:

从源代码进行安装同样适用于其它平台的Linux,但必须在Linux系统中安装gcc编译器。

A.下载源代码软件包
http://www.roaringpenguin.com/pppoe/rp-pppoe-3.2.tar.gz

B.解压缩

#tar xvfz rp-pppoe-3.2.tar.gz
#cd rp-pppoe-3.2
C.进行编译和安装

运行脚本
#./go
将自动进行编译和安装,最后,调用/usr/sbin/adsl-setup进行配置,具体解释见三。

三、配置PPPOE客户端软件

安装完软件包后,必须配置pppoe的配置文件/etc/ppp/pppoe.conf,从而让ADSL拨号时使用配置文件中的用户名、密码等参数。我们不必手工改动这个文件,可以使用adsl-setup这个工具进行配置:

#/usr/sbin/adsl-setup

当出现
>>> Enter your PPPoE user name :
输入ADSL帐号的用户名

当出现
>>> Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0):
输入 eth0 ,这是ADSL相连的网卡的名字

当出现
>>> Enter the demand value (default no):
输入 no

当出现
>>> Enter the DNS information here:
输入 server ,这表示使用ADSL拨号自动获得的DNS服务器IP地址

当出现
>>> Please enter your PPPoE password:
输入ADSL帐号的密码

当出现
>>> Choose a type of firewall (0-2):
输入 0 ,不使用防火墙

当出现
>>> Accept these settings and adjust configuration files (y/n)?
如果输入的信息正确,输入 y ,完成配置,否则,输入 n 重新输入。

四、启动PPPOE客户端软件

使用命令

/usr/sbin/adsl-start 启动PPPOE客户端软件,进行连接,如果成功,将出现
Connected;
如果不成功,请检查网线、ADSL MODEM等物理设备,并查看 /var/log/messages中的信息
/usr/sbin/adsl-stop 关闭和ISP的连接
/usr/sbin/adsl-status 查看当前连接的状态

如果想在Linux系统启动时自动启动ADSL连接,输入以下命令
#chkconfig --add adsl
将在当前的运行级下加入ADSL的自启动脚本

五、测试

当连接成功后,使用命令
#ifconfig -a

在输出中应该含有关于 ppp0 的一堆信息,其中还绑定了 IP 地址,说明已经从拨号中获得了IP地址。

使用命令

#netstat -nr

查看路由表信息,这时的默认路由应该是上面获得的IP地址。
如果没有默认路由,我们可以手动增加:

#route add default gw 上面获得的IP地址

使用命令

#nslookup www.sina.com.cn

如果解析出新浪的IP,说明已经从拨号中正确获得了DNS服务器

最后,使用命令ping某个域名或IP,如果有响应,表示你已经大功告成了。

六、其它说明

RedHat Linux 7.1已经集成了rp-pppoe这个软件包,只不过版本有些低,如果你不在意版本高低,可以直接进行三后面的步骤。

Friday, June 13, 2008

AP News (Jun.13.2008)

1. A group of Boy Scouts have been praised for coming to each other’s aid after a tornado struck their western Iowa camp. Four young men were killed, and nearly 50 others were hurt, 14 of them remain hospitalized. The teens were attending a week-long leadership training camp when the twister struck last night.

2. And parts of the Midwest have been swamped by flood water. Thousands of people have been evacuated as severe thunderstorms hit already flood-ravaged places. More than a half of Iowa’s counties have been declared state disaster areas.

3. Another setback for the Bush administration. The Supreme Court ruled the government is violating Guantanamo Bay detainees’ rights by holding them indefinitely and without charges. President Bush says he'll abide by the High Court's decision.

4. There is word a European brewer has offered 46 billion dollars to buy Anheuser-Busch, the maker of Budweiser, Bud Light and other brands. The news helped give Wall Street a rebound but stocks turned mixed late in the day.

Thursday, June 12, 2008

AP News (Jun.12.2008)

1. A sandbagged levee is still keeping the Cedar River out of downtown Cedar Falls, Iowa. But more rain is following and officials are asking for extra volunteer sandbaggers. Forecasters say a dry spell could be coming soon.

2. Low humidity and 40-mile-an-hour wind gusts are expected to make things tougher for crews battling wildfires in northern California. A blaze near Sacramento has already destroyed nearly 50 homes and buildings with another 275 threatened. Officials say the fire is about 60% contained.

3. Gasoline has reached another record. The national average is now $ 4.05 a gallon. The declining dollar and lower-than-expected oil stocks have pushed crude prices up again in New York.

4. And in Atlanta, a bizarre incident at a gas station. Witnesses say this man pulled in and started dancing naked on top of his car before getting back in, slamming his car into a row of gas pumps setting them on fire. Fire crews extinguished the blaze before it could spread to more pumps.

Wednesday, June 11, 2008

AP News(Jun.11.2008)

1. A plane carrying about 200 passengers veered off a runway in Sudan and burst into flames. Local television reports at least 100 people are dead. The Sudan Airways plane was landing in Khartoum at the end of a flight from Amman, Jordan.

2. In Wisconsin, authorities are watching dams in this rain-soaked state after a breach nearly emptied Lake Delton, washing away homes and a highway. A swamp of the Midwest is recovering from drenching storms. The weather is blamed for at least 15 deaths.

3. In the Senate, Republicans blocked a bill that would have imposed a new tax on profits from oil companies. Senators say the bill would have meant higher prices and increased oil imports. Meantime, gas prices rose another two cents to a national average of $4.04 a gallon.

4. On the side of a building in Japan, this woman tucks into bed, almost falling asleep. All part of a promotional stunt advertising a chain of hotels.

Tuesday, June 10, 2008

AP News (Jun.10.2008)

1. The true power of nature was on full display throughout the Midwest. Raging flood waters are still tearing through southern Indiana, swallowing farmland and homes. So far eight people have died from flooding in Michigan and Indiana.

2. McDonald's has stopped serving sliced tomatoes in its US restaurants. That's after concerns about salmonella food poisoning linked to some uncooked varieties. The grocer Winn-Dixie Stores said it was also taking some tomatoes off its shelves.

3. "It's good to be home. " That's from Senator Ted Kennedy after he returned to his family's compound on Cape Cod. The Massachusetts senator has been recovering from surgery to treat a cancerous brain tumor for the past week.

4. Apple has unveiled an upgraded iPhone with a faster Internet connection and GPS capabilities. Analysts say Apple needed to upgrade the iPhone's Internet connection to work over third-generation wireless networks. The company is hoping to hit its target of selling ten million of the devices by the end of the year.

Monday, June 09, 2008

AP News (Jun.9.2008)

1. At least three people are dead after severe storms hit the Midwest. In Indiana, rescuers in boats are still plucking people from rising waters, as parts of the state brace for more flooding. The storm also brought tornados, this one touched down near Chicago.

2. Investigators in Texas say a fire at the historic Governor's Mansion in Austin was likely arson. State officials say the damage borders on catastrophic. No one was inside the 152-year-old building when the blaze broke out. It had been undergoing a ten-million-dollar renovation.

3. The national average price for unleaded gas now tops the four-dollar-a-gallon mark. The highest average prices are in states like Alaska, California, Connecticut and Washington state. AAA says gas prices have gone up an average of about 33 cents a gallon since this time last month. Analysts say that's about 90 cents since this time last year.

4. Rafael Nadal has won his fourth straight French Open. Nadal won six consecutive games, dispatching Roger Federer with ease. It's the third straight year the two have met in the final.

A Fake Nokia BL-5F batt.

  I've dissembled a Nokia BL-5F battery, which i thought is a fake one.

09062008116
The battery has been used only several days, but i can see it has a seriously unshaped. The only thing i could certain is the core of it had wore out.

09062008121

Tore off the sticky paper of the battery carefully,  we will find a metal sealed core. That's it.

09062008123

Due to this sucked quality core, the user will risking his life while using it.

Sunday, June 08, 2008

AP News (Jun.8.2008)

1. Senator Hillary Clinton has suspended her bid for the presidency. The former first lady was greeted by thousands of supporters in Washington. She's urging everyone to support Senator Barack Obama as the Democratic nominee.
2. Residents in northern Minnesota are cleaning up after strong storms ripped through parts of the Midwest, smashing houses and leaving thousands without power. The situation has been made worse for residents by hot temperatures baking the region.

3. The Olympic torch relay continues. It's now going through Nanning, China. There was a moment of silence at the beginning of the relay to remember the victims of last month's devastating earthquake.
4. Veteran sportscaster Jim McKay died of natural causes at his farm in Monkton, Maryland at the age of 86. When a raid to rescue Israeli athletes captured by terrorists during the 1972 Munich Olympics ended in tragedy, it was McKay who told Americans "They are all gone."

Wednesday, June 04, 2008

AP News (Jun.4.2008)

1. Barack Obama has effectively clinched the Democratic presidential nomination. Based on an Associated Press count of convention delegates, Obama has enough to become the first black candidate ever to lead his party into a fall campaign for the White House. The Illinois senator is also picking up the endorsement of former President Jimmy Carter.

2. Hillary Rodham Clinton has reportedly said she is open to being Barack Obama's vice presidential candidate. The comments were made on a conference call to New York lawmakers. Clinton is addressing supporters tonight in New York after the South Dakota and Montana primary results come in.

3. Reunions continue today in Texas for polygamous families and their children. Child welfare officials say most of the remaining children will be out of foster homes today. Although some parents are being told they may have to wait a few more days.

4. President Bush has honored the University of Kansas basketball team. The president met with the 2008 NCAA champs at Rose Garden ceremony. KU pulled out the title for the first time since 1988 when the team was last lauded at the White House.

Tuesday, June 03, 2008

AP News (Jun.3.2008)

1. Senator Ted Kennedy is out of surgery at Duke University. His doctor says a procedure to treat his cancerous brain tumor was successful. The 76-year-old now faces chemotherapy and radiation to treat the malignant glioma, a lethal type of brain tumor.

2. A Texas judge has placed some tight restrictions on the parents of 400 children who are being allowed to return to their polygamist compound. Among other things, the parents have to allow unannounced visits from the state.

3. Neil Entwistle arrived at a Boston-area courthouse for the beginning of his murder trial under heavy security. It's been nearly two years since he was charged with killing his wife and nine-month-old daughter.

4. Space shuttle Discovery performed a slow back flip and then docked at the International Space Station. It's delivering a massive lab and two new occupants: a NASA astronaut and Buzz Lightyear.

Monday, June 02, 2008

AP News (Jun.2.2008)

1. Fire crews in California are still cleaning up after a massive fire at Universal Studios. The blaze destroyed several sets including one from "Back to the Future". A King Kong exhibit and a video vault were also destroyed. Three firefighters were hurt. The cause isn't yet known.

2. Hillary Rodham Clinton has won Puerto Rico's primary. Fifty-five delegates are at stake there. However, Barack Obama is favored in the final two primaries Tuesday in Montana and South Dakota.

3. The Chicago priest whose comments about Hillary Clinton reignited the controversy over Barack Obama's former church has apologized to his parishioners. At his own church today, the Rev. Michael Pfleger said he isn't racist or sexist. He said the past few days have been the most painful of his life.

4. Space shuttle Discovery's seven-member crew has wrapped up an hours-long inspection to look for any signs of damage to its ship. About five pieces of debris broke off the fuel tank during lift-off yesterday, but none during the crucial first two minutes.

Friday, May 30, 2008

AP News (May.30.2008)

1. Scott McClellan, former press secretary for President Bush, says he got caught up in what he calls "the Washington game" instead of changing things like the president promised. McClellan has written a tell-all memoir that's critical of Bush.

2. A medical helicopter crashes on the roof of a hospital in Grand Rapids, Michigan, catching fire. Two people on board escaped with minor injuries. No patients were on board. An eyewitness says pieces were flying in the air after the crash.

3. A letter from Barack Obama's senate doctor says the presidential candidate is in excellent health, writing that the 46-year-old Obama is a regular jogger with no excess body fat.

4. Help is on the way for the crew aboard the International Space Station where the only toilet is having some trouble. Replacement parts are coming, on board the space shuttle Discovery, set to blast off Saturday

Wednesday, May 28, 2008

AP News (May.28.2008)

1. Seven people are now dead after a devastating tornado struck Iowa on Sunday. Around the hard-hit area of Parkersburg people are trying to recover what they can. Officials say a total of 350 homes were destroyed, more than 200 just in Parkersburg.

2. John McCain says both Republicans and Democrats haven't been doing enough to control the spread of nuclear weapons. The Arizona Republican says he favors an approach that doesn't rely too heavily on direct talks or military force.

3. More international aid is finally on the way to victims of Myanmar's cyclone. Officials say foreign workers have begun entering the country's hard-hit delta area after being blocked for weeks by the military junta. Officials now put the death toll at about 78,000.

4. NASA says fresh images from the Phoenix Mars Lander show most of its science instruments are in good shape. The one snag on the lander happened when the protective sheath around the robotic arm didn't unwrap all the way after touchdown.

Tuesday, May 27, 2008

AP News (May.27.2008)

1. At least seven people have been killed in severe weather that tore through the Midwest. Some of the worst damage was in Parkersburg, Iowa where homes and a high school were destroyed. Forecasters are keeping an eye out for more severe weather today.

2. Americans are paying tribute to fallen troops in Memorial Day observances. President Bush today laid a wreath at the Tomb of the Unknowns and spoke of the sacrifices of service members and their families.

3. Republican presidential candidate John McCain spent Memorial Day defending his opposition to legislation that would give additional college financial aid to veterans. McCain said his position is the right one rather than the politically expedient one. Barack Obama supports the measure which passed the Senate.

4. After a historic, near perfect landing NASA's Phoenix Mars Lander is getting ready to begin testing the polar surface for signs of water and life. The lander has already sent back some photos of the area, giving scientists the first-ever glimpse of the Red Planet's high northern latitudes.

Atlantis Focuses On Wraith

The upcoming fifth season of SCI FI Channel's original series Stargate Atlantis will focus heavily on the Wraith--with a side trip to Las Vegas to commemorate the show's 100th episode, producers told SCI FI Wire during a visit to the show's sets in Vancouver, Canada, on May 16. (Spoilers ahead!)
Other key developments: Teyla (Rachel Luttrell) will have her baby in the fifth season. The character became pregnant last season to accommodate Luttrell's real-life pregnancy. Luttrell has given birth, so her character can follow suit. The baby is delivered on camera by Dr. McKay (David Hewlett). (Inside word is it's a boy!)
Teyla also sees her abilities get out of hand in an episode in which she touches the mind of a Wraith Queen, which activates her Wraith DNA. According to Luttrell, Teyla "embodies" the Wraith Queen--the actress will appear in full Wraith makeup--and becomes "the leader of an alliance of Wraith."
Also look for the return of the Wraith-worshipping Satedan Tyre (Mark Dacascos) in an episode in which he captures Ronon (Jason Momoa) and attempts to sacrifice him to the Wraith. Ronon is given so much Wraith enzyme in the episode that he gives in completely to his dark side and apparently does some serious damage to Sheppard (Joe Flanigan).
Momoa said that he got so deep into his character's rage in the episode that he actually broke a gurney he was strapped to. Momoa called the episode the most fun he's ever had as an actor. (Contrary to previous speculation, however, Momoa does not lose his trademark dreadlocks in the episode.)
Even Dr. Jennifer Keller (Jewel Staite) and Richard Woolsey (Robert Picardo) have close encounters with Wraiths in the coming season, the actors confirmed. Staite said that her character will be trapped with a Wraith in one episode. Picardo cited a moment when Woolsey is about to be killed by a Wraith, as an example of his character's emerging courage.
Not everything is about the Wraith though. Flanigan said it's his understanding that filming for the show's upcoming 100th episode will take place in Las Vegas. Though Flanigan claimed to have no more details than that, he surmised that this would probably mean the episode will have to do with the replicators.
Six episodes of Stargate Atlantis' new season are complete, and filming of new episodes continues. The fifth season kicks off in July. --John Sullivan

Monday, May 26, 2008

AP News (May.26.2008)

1. Thousands of motorcyclists are converging in Washington, D.C. for the annual Memorial Day weekend Rolling Thunder Rally. Earlier Sunday, members met with President Bush at the White House and gave him his own leather vest. They also discussed concerns relating to veterans' care and rights.

2. There's been more destruction in central China today after a powerful aftershock. The latest temblor destroyed another 71,000 homes. At least one person was killed, more than 400 were injured.

3. A large cargo plane crashed and broke apart close to a row of houses while trying to abort a takeoff Sunday at Brussels Airport. The plane skidded to a halt in a field at the end of a runway. Four of the five crew members on board the plane were slightly injured and were hospitalized.

4. Triple Crown contender Big Brown has missed two days of training with a slight injury to his left front foot, but a trainer says the colt should be fine for the Belmont Stakes. That race is in less than two weeks. Big Brown could become the first Triple Crown champion since Affirmed in 1978.

Sunday, May 25, 2008

AP News (May.25.2008)

1. It is a weekend to remember those serving the country. President Bush is asking Americans to pause on Monday for a moment of remembrance. At Arlington National Cemetery, each headstone is being marked with an American flag.


2. Presidential candidate Senator Barack Obama is not backing away from criticizing Republican contender John McCain for opposing legislation providing scholarships to those serving in the military. McCain says the benefit will encourage people to leave the service after one enlistment.


3. On the streets of two European cities, rioters clash with police. In Italy, the issue is who gets garbage from Naples. In Belgium, groups sparred after a soccer game.

4. In Beijing, eight pandas settle into a new home after the devastating Chinese earthquake destroyed their preserve. The two-year-old pandas will be here for months, part of a special exhibition at Beijing Zoo for the Summer Olympics.

ARGUMENT16

TOPIC: ARGUMENT16 - The following appeared in a letter to the editor of a local newspaper from a citizen of the state of Impecunia.

"Two years ago our neighboring state, Lucria, began a state lottery to supplement tax revenues for education and public health. Today, Lucria spends more per pupil than we do, and Lucria's public health program treats far more people than our state's program does. If we were to establish a state lottery like the one in Lucria, the profits could be used to improve our educational system and public health program. The new lottery would doubtless be successful, because a survey conducted in our capital city concludes that citizens of Impecunia already spend an average of $50 per person per year on gambling."

WORDS: 376 TIME: Unlimited DATE: 2008-5-25 22:01:00

The author said that their neighboring state, Lucria has a state lottery to supplement tax revenues for education and public health. And the author also concludes that if their state, Impecunia, has a lottery like that, the lottery would be doubtless successful and the profit could be used to improve their educational system and public health program. However, the author fails to convince anybody that the lottery can be profitable.

Firstly, the author's point depends on the assumption that the survey is statistically reliable. Yet, the author offers no evidence to substantiate this assumption. The author must show that not only the quantities of the conducted samples are sufficient, but the samples can represent of every level of age and jobs. Without a statistically reliable survey, the author cannot make any conclusions based on it.

In addition, the author think that the person who spending on gambling will also spending on lottery. Though lottery is a special pattern of gambling, but they are not same. The survey fails to show which patterns of gambling people intend to, thus we cannot predict that whether the lottery can be accept by the players of gambling.

Secondly, the author's inference that the Lucria's state lottery which is effective in Lucria will also be effective in Impecunia rests on the poor assumption that the two states in any aspects are the same. Perhaps Lucria has fewer population of pupil and groups that requires health treatment than us, thus Lucria can spend more on every pupil they has and the person who needs health service.

Furthermore, Lucria started the state lottery two years ago, the author draws the conclusion that the lottery will doubtless be successful if it starts in Impecunia based on the consumers of the lottery can keep increasing in the future. However, we cannot foresee if more consumers of Impecunia will play with this lottery in the future, therefore, we cannot assume that the lottery will be successful let alone about the lottery can be profitable.

In all, the survey provided by the author, which is the base of the new lottery assumption in Impecunia, is lack of statistically credit. Without a credible survey and a reasonable assumption, the author's suggestion about lottery in Impecunia cannot be adopted.

Saturday, May 24, 2008

AP News (May.24.2008)

1. Officials in Texas are taking the polygamist sect case to the state's highest court. Today they file their appeal of a lower court ruling which stated officials didn't have the right to take more than 400 kids from their parents.

2. Crews in Colorado are busy cleaning up after yesterday's powerful storms that tore apart homes and businesses. Many residents are just now getting back to their houses to see if there is anything left worth salvaging.
3. Officials in China are trying to secure 15 sources of radiation that were buried in the rubble of last week's earthquake. Meantime, the government is moving thousands of survivors living downstream of rivers that have been dammed by landslides. Officials fear those could give way as aftershocks continue.

4. Just as Memorial Day weekend begins, gas prices have reached another record high. The average price of a gallon of regular rose 4 cents overnight to settle at nearly $3.88. Analysts say they expect that number to keep climbing.

Thursday, May 22, 2008

AP News (May.23.2008)

1. A Texas appeals court has ruled that state officials had no right to seize more than 400 children living at a polygamous group’s ranch. Those children are now with foster parents. The court did not order them back to their families.

2. Strong winds are fueling an out-of-control wildfire that has scotched thousands of acres in central California. The blaze is threatening rural homes and has forced officials to close schools and evacuate certain areas.

3. Former White House top political adviser Karl Rove is being subpoenaed to appear before Congress. The House Judiciary Committee is calling on him to testify about whether the White House improperly meddled with the Justice Department.

4. Some D-C motorists (are) driving happy today, thanks to a free gas giveaway. Drivers lined up for blocks early this morning to get their 40 dollars worth of free gas. Some say while this won’t fuel the tank, it will get them through the holiday weekend.