您尚未登录。

#1 2014-01-19 09:22:46

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

[SOLVED]铁通网络该如何上网

原先在学校用客户端能上网,现在在家,用的是铁通的网络。之前用windows是要输入电话号码与密码的,不过好像后来直接开机就能上网了(不用手动点拨号)。现在用arch开机,dhcpcd启动并自动修改了之前的resolv.conf,ping一个网站不通(但不是unknown host),看起来dns应该是设置好的。
现在要上网应该用什么方法上呢?大概搜索了下,是不是要用ppp或adsl之类的。请大家给个方向,我再去仔细看下,谢谢。

最近编辑记录 Frefreak (2014-01-20 15:14:49)

离线

#2 2014-01-19 09:59:14

cuihao
所在地: USTC, Hefei
注册时间: 2011-08-19
帖子: 1,223
个人网站

Re: [SOLVED]铁通网络该如何上网

“用windows是要输入电话号码与密码的”
在哪里输、怎么输的?


Site: CVHC.CC   Twitter: @cuihaoleo   Org: LUG@USTC
AD:  ~欢迎参与志愿计算~

离线

#3 2014-01-19 10:35:55

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

cuihao 说:

“用windows是要输入电话号码与密码的”
在哪里输、怎么输的?

右下角system tray的网络图标,左击打开网络列表,在“拨号和VPN”下有一个“宽带连接”,点“连接”后弹出对话框,账号密码保存了,直接点连接的按钮就能连上了。

离线

#4 2014-01-19 15:18:27

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: [SOLVED]铁通网络该如何上网

宽带连接的话是 pppoe 吧。
ping 不是 unknown host 那是什么?

提问时记住:你不能理解的不代表别人也不能理解,所以请贴出来,也许那就是解决问题的关键。另外记住不要用「看起来」「我觉得」「也许是」之类的字眼。模糊的表述对解决问题毫无助益,反而可能误导人。如果不能毫无疑惑地断定,那么你只要说明你遇到了什么就好。

离线

#5 2014-01-19 18:50:31

balalaxmx
小魔仙小组组长
所在地: 河南郑州
注册时间: 2013-08-07
帖子: 29

Re: [SOLVED]铁通网络该如何上网

最简单的解决办法:买一个路由器……


喜欢小魔仙的男孩子

离线

#6 2014-01-19 21:40:29

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

百合仙子 说:

宽带连接的话是 pppoe 吧。
ping 不是 unknown host 那是什么?

按下回车后,cursor停在第二行,等待用户输入的样子。

刚刚按wiki的说明试了下pppd(https://wiki.archlinux.org/index.php/Pppd),创建了这样一个配置文件:
/etc/ppp/peers/tietong

plugin rp-pppoe.so
# rp_pppoe_ac 'your ac name'
# rp_pppoe_service 'your service name'
  
# network interface
enp7s0              # ip link show显示的
# login name
name "1376747xxxx"  # 填了我的上网账号
usepeerdns
persist
# Uncomment this if you want to enable dial on demand
#demand
#idle 180
defaultroute
hide-password
noauth

然后在/etc/ppp/pap-secrets和/etc/ppp/chap-secrets都加入了:

1376747xxxx * xxxxxx  # 填了我的上网账号和密码

然后pppd call tietong 还是不行,ip link show里有了ppp0,可是还是没出现ip地址。/var/log/errors.log 与 /var/log/everything.log这两个文件都没出现。

也试了下netctl,复制了/etc/netctl/examples/pppoe到/etc/netctl/,修改后netctl start pppoe情况相似,journalctl -xn提示里有timeout(我是在arch的急救盘里试的,不方便贴原文,如果需要我再去把它导出来)。

balalaxmx 说:

最简单的解决办法:买一个路由器……

好像已经有了……

按我爸的说法,家里的两台电脑一台要手动点连接,一台直接开机就能上(但是不清楚这两个都配置了些什么)。现在问题还没解决,郁闷啊……一个多月不Syu会不会挂啊。。。

离线

#7 2014-01-19 22:21:01

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: [SOLVED]铁通网络该如何上网

ping 停止输出的话是丢包了。你按 Ctrl-C 能够得到一个 100% 丢包率的消息。

ppp0 有了的话就说明链接层已经搞定啦~你还缺少一个 IP 地址来进行网络层通信,试试 dhcpcd ppp0 能不能动态获取一个?

现在一直没会导致挂载的更新,所以不用担心的喵 =w=

离线

#8 2014-01-20 11:19:48

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

今天再试了几次pppd,每次试完后在journalctl -xn中好像能看到信息。
还是按6L所说的配置,pppd call tietong后ip link show出现ppp0(没ip地址),在journalctl -xn看到如下信息:

-- Logs begin at Mon 2014-01-20 10:52:29 UTC, end at Mon 2014-01-20 10:54:18 UTC. --
Jan 20 10:54:18 archiso pppd[591]: peer from calling number 00:22:93:54:B4:A0 authorized
Jan 20 10:54:18 archiso dhcpcd[597]: ppp0: soliciting an IPv6 router
Jan 20 10:54:18 archiso dhcpcd[597]: ppp0: waiting for 3rd party to configure IP address
Jan 20 10:54:18 archiso pppd[591]: not replacing existing default route via 192.168.1.1
Jan 20 10:54:18 archiso pppd[591]: Cannot determine ethernet address for proxy ARP
Jan 20 10:54:18 archiso pppd[591]: local  IP address 123.75.140.4
Jan 20 10:54:18 archiso pppd[591]: remote IP address 123.75.140.1
Jan 20 10:54:18 archiso pppd[591]: primary   DNS address 61.235.0.228
Jan 20 10:54:18 archiso pppd[591]: secondary DNS address 211.98.2.4
Jan 20 10:54:18 archiso dhcpcd[597]: ppp0: removing IP address 0.0.0.0/0

dhcpcd ppp0后提示timeout:

-- Logs begin at Mon 2014-01-20 10:52:29 UTC, end at Mon 2014-01-20 10:55:23 UTC. --
Jan 20 10:54:48 archiso dhcpcd[597]: timed out
Jan 20 10:54:48 archiso dhcpcd[597]: exited
Jan 20 10:54:48 archiso systemd[1]: dhcpcd@ppp0.service: control process exited, code=exited status=1
Jan 20 10:54:48 archiso systemd[1]: Failed to start dhcpcd on ppp0.
-- Subject: Unit dhcpcd@ppp0.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit dhcpcd@ppp0.service has failed.
-- 
-- The result is failed.
Jan 20 10:54:48 archiso systemd[1]: Unit dhcpcd@ppp0.service entered failed state.
Jan 20 10:54:53 archiso dhcpcd[810]: version 6.1.0 starting
Jan 20 10:54:53 archiso dhcpcd[810]: ppp0: soliciting an IPv6 router
Jan 20 10:54:53 archiso dhcpcd[810]: ppp0: waiting for 3rd party to configure IP address
Jan 20 10:55:23 archiso dhcpcd[810]: timed out
Jan 20 10:55:23 archiso dhcpcd[810]: exited

另外我看到在/etc/ppp/下面有一个pppoe.conf,里面的配置和之前的peers下方创建的文件内容很像,我随便改了几个地方:

#***********************************************************************
#
# pppoe.conf
#
# Configuration file for rp-pppoe.  Edit as appropriate and install in
# /etc/ppp/pppoe.conf
#
# NOTE: This file is used by the pppoe-start, pppoe-stop, pppoe-connect and
#       pppoe-status shell scripts.  It is *not* used in any way by the
#       "pppoe" executable.
#
# Copyright (C) 2000 Roaring Penguin Software Inc.
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# LIC: GPL
# $Id$
#***********************************************************************

# When you configure a variable, DO NOT leave spaces around the "=" sign.

# Ethernet card connected to DSL modem
ETH=enp7s0

# PPPoE user name.  You may have to supply "@provider.com"  Sympatico
# users in Canada do need to include "@sympatico.ca"
# Sympatico uses PAP authentication.  Make sure /etc/ppp/pap-secrets
# contains the right username/password combination.
# For Magma, use xxyyzz@magma.ca
USER=1376747xxxx    #modified 

# Bring link up on demand?  Default is to leave link up all the time.
# If you want the link to come up on demand, set DEMAND to a number indicating
# the idle time after which the link is brought down.
DEMAND=no
#DEMAND=300

# DNS type: SERVER=obtain from server; SPECIFY=use DNS1 and DNS2;
# NOCHANGE=do not adjust.
DNSTYPE=SERVER

# Obtain DNS server addresses from the peer (recent versions of pppd only)
# In old config files, this used to be called USEPEERDNS.  Changed to
# PEERDNS for better Red Hat compatibility
PEERDNS=yes

DNS1=
DNS2=

# Make the PPPoE connection your default route.  Set to
# DEFAULTROUTE=no if you don't want this.
DEFAULTROUTE=yes

### ONLY TOUCH THE FOLLOWING SETTINGS IF YOU'RE AN EXPERT

# How long pppoe-start waits for a new PPP interface to appear before
# concluding something went wrong.  If you use 0, then pppoe-start
# exits immediately with a successful status and does not wait for the
# link to come up.  Time is in seconds.
#
# WARNING WARNING WARNING:
#
# If you are using rp-pppoe on a physically-inaccessible host, set
# CONNECT_TIMEOUT to 0.  This makes SURE that the machine keeps trying
# to connect forever after pppoe-start is called.  Otherwise, it will
# give out after CONNECT_TIMEOUT seconds and will not attempt to
# connect again, making it impossible to reach.
CONNECT_TIMEOUT=30

# How often in seconds pppoe-start polls to check if link is up
CONNECT_POLL=2

# Specific desired AC Name
ACNAME=

# Specific desired service name
SERVICENAME=

# Character to echo at each poll.  Use PING="" if you don't want
# anything echoed
PING="."

# File where the pppoe-connect script writes its process-ID.
# Three files are actually used:
#   $PIDFILE       contains PID of pppoe-connect script
#   $PIDFILE.pppoe contains PID of pppoe process
#   $PIDFILE.pppd  contains PID of pppd process
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"

# Do you want to use synchronous PPP?  "yes" or "no".  "yes" is much
# easier on CPU usage, but may not work for you.  It is safer to use
# "no", but you may want to experiment with "yes".  "yes" is generally
# safe on Linux machines with the n_hdlc line discipline; unsafe on others.
SYNCHRONOUS=no

# Do you want to clamp the MSS?  Here's how to decide:
# - If you have only a SINGLE computer connected to the DSL modem, choose
#   "no".
# - If you have a computer acting as a gateway for a LAN, choose "1412".
#   The setting of 1412 is safe for either setup, but uses slightly more
#   CPU power.
CLAMPMSS=1412
#CLAMPMSS=no

# LCP echo interval and failure count.
LCP_INTERVAL=20
LCP_FAILURE=3

# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
PPPOE_TIMEOUT=80

# Firewalling: One of NONE, STANDALONE or MASQUERADE
FIREWALL=NONE

# Linux kernel-mode plugin for pppd.  If you want to try the kernel-mode
# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
LINUX_PLUGIN=

# Any extra arguments to pass to pppoe.  Normally, use a blank string
# like this:
PPPOE_EXTRA=""

# Rumour has it that "Citizen's Communications" with a 3Com
# HomeConnect DSL Modem DualLink requires these extra options:
# PPPOE_EXTRA="-f 3c12:3c13 -S ISP"

# Any extra arguments to pass to pppd.  Normally, use a blank string
# like this:
PPPD_EXTRA=""


########## DON'T CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
# If you wish to COMPLETELY overrride the pppd invocation:
# Example:
# OVERRIDE_PPPD_COMMAND="pppd call dsl"

# If you want pppoe-connect to exit when connection drops:
# RETRY_ON_FAILURE=no

然后用pppoe-start,结果和上面一种方法几乎一样(它们两个用的应该是同一个原理的东西吧)

-- Logs begin at Mon 2014-01-20 10:42:30 UTC, end at Mon 2014-01-20 10:46:25 UTC. --
Jan 20 10:45:56 archiso pppd[614]: local  IP address 123.75.141.96
Jan 20 10:45:56 archiso pppd[614]: remote IP address 123.75.140.1
Jan 20 10:45:56 archiso pppd[614]: primary   DNS address 61.235.0.228
Jan 20 10:45:56 archiso pppd[614]: secondary DNS address 211.98.2.4
Jan 20 10:45:56 archiso dhcpcd[617]: ppp0: removing IP address 0.0.0.0/0
Jan 20 10:46:25 archiso dhcpcd[617]: timed out
Jan 20 10:46:25 archiso dhcpcd[617]: exited
Jan 20 10:46:25 archiso systemd[1]: dhcpcd@ppp0.service: control process exited, code=exited status=1
Jan 20 10:46:25 archiso systemd[1]: Failed to start dhcpcd on ppp0.
-- Subject: Unit dhcpcd@ppp0.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit dhcpcd@ppp0.service has failed.
-- 
-- The result is failed.
Jan 20 10:46:25 archiso systemd[1]: Unit dhcpcd@ppp0.service entered failed state.

dhcpcd ppp0:

-- Logs begin at Mon 2014-01-20 10:42:30 UTC, end at Mon 2014-01-20 10:47:26 UTC. --
Jan 20 10:46:25 archiso dhcpcd[617]: timed out
Jan 20 10:46:25 archiso dhcpcd[617]: exited
Jan 20 10:46:25 archiso systemd[1]: dhcpcd@ppp0.service: control process exited, code=exited status=1
Jan 20 10:46:25 archiso systemd[1]: Failed to start dhcpcd on ppp0.
-- Subject: Unit dhcpcd@ppp0.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit dhcpcd@ppp0.service has failed.
-- 
-- The result is failed.
Jan 20 10:46:25 archiso systemd[1]: Unit dhcpcd@ppp0.service entered failed state.
Jan 20 10:46:56 archiso dhcpcd[848]: version 6.1.0 starting
Jan 20 10:46:56 archiso dhcpcd[848]: ppp0: soliciting an IPv6 router
Jan 20 10:46:56 archiso dhcpcd[848]: ppp0: waiting for 3rd party to configure IP address
Jan 20 10:47:26 archiso dhcpcd[848]: timed out
Jan 20 10:47:26 archiso dhcpcd[848]: exited

两种方法在建立连接后,在journalctl -xn中都看到了和ip用关的信息,如果按照信息中的ip手动指定ip会不会有用呢?具体应该如何做呢。。。
如果实在不行的话,找几个时间蹭下网什么的来更新还是可以的。

离线

#9 2014-01-20 12:29:18

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: [SOLVED]铁通网络该如何上网

看起来你的 pppoe 服务会推送指定的 IP 地址,并且不支持 DHCP。那么就不应该用 dhcpcd 了。但是默认情况似乎在使用 dhcpcd。systemctl disable dhcpcd@ppp0.service 并 systemctl stop dhcpcd@ppp0.service 试试?
这个应该是 Arch 的 ISO Live 系统吧?如果弄不明白是哪里启动的 dhcpcd 的话,先通杀一遍: killall dhcpcd,然后手动指定你在日志里看到的 IP 地址: ip address add local <IP1> peer <IP2> dev ppp0。

最近编辑记录 依云 (2014-01-20 12:30:15)

离线

#10 2014-01-20 13:11:52

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

IP1 和 IP2指的是日志中的local IP & remote IP? 我输入后提示:

RTNETLINK answers: File exists

另外我发现ip link show中是没有这些ip的,但是ip addr show中ppp0条目下有类似于 inet 127.75.136.188 peer 123.75.136.1/32 ,和我在当次的日志中看到的local ip & remote ip是一样的。

离线

#11 2014-01-20 13:43:50

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: [SOLVED]铁通网络该如何上网

ip link 中当然没有这些 IP 啦。有 IP 之后还是上不了网?ping peer 试试?

离线

#12 2014-01-20 14:44:34

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

还是不行,再重复一下过程吧,改完配置文件后,pppd call tietong,这时ip link show 无ip(原来没有是正常的),ip addr show在ppp0下直接有了,且地址和日志中的一样(有时候call一次没用,要多试几次,win7上直接拨号也会有不能一次成功的时候),比如这次是

inet 123.75.183.249 peer 123.75.182.1/32 scope global ppp0

而enp7s0中是

inet 192.168.1.101/24 brd192.168.1.255 scope global enp7s0

不过/etc/resolv.conf中的nameserver还是192.168.1.1,没有变成日志里的DNS,手动改或不改,表现都一样:

ping www.baidu.com # 没有出现PING xxx.xxx.xxx.xxx 56(84) bytes of data这样的信息,而是直接空白的,过了很久后提示unknown host
ping 123.75.183.249 # local: 能通,time很小(0.04左右ms)
ping 123.75.182.1 # peer: 能通,time=13~15ms
ping 61.235.0.228 # 两个DNS都ping不通

killall dhcpcd后再call什么的,结果也一样……
因为我硬盘上的系统是没有ppp的,所以现在是在12月的那个archiso做成的U盘上试,想着如果这个能成功,再arch-chroot后安装ppp到我的系统上。

EDIT: 刚刚在网上搜到一篇文章,说是要改什么默认路由,抱着试试的心态试了下,结果真的成功的。具体就是在手动改resolv.conf之后,

ip route add default dev ppp0

这时就能正常上网了,希望这个帖子能对有类似问题的人有帮助。最后感谢大家的帮助~

最近编辑记录 Frefreak (2014-01-20 15:14:22)

离线

#13 2014-01-20 15:57:14

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: [SOLVED]铁通网络该如何上网

看到你 EDIT 前边那里我就知道你的路由表因为奇怪的原因不对了……
大概是系统尝试在 enp7s0 上自动获取 IP,然后还真成功了,于是默认路由就走那里了……

离线

#14 2014-01-20 16:27:42

Frefreak
会员
注册时间: 2014-01-19
帖子: 10

Re: [SOLVED]铁通网络该如何上网

百合仙子 说:

看到你 EDIT 前边那里我就知道你的路由表因为奇怪的原因不对了……
大概是系统尝试在 enp7s0 上自动获取 IP,然后还真成功了,于是默认路由就走那里了……

嗯……其实之前的错误日志里有pppd[nnnn]: not replacing existing default route via xx.xx.xx.xx , 这句在pppd的wiki上有提到,之前没注意。
多谢啦~

离线

页脚