[胡说八不道]Ubuntu上网问题解决方案汇总

1.开机自动连接问题

官方WIKI有解答



2.禁用IPV6



打开文件 /etc/modprobe.d/aliases

把 alias net-pf-10 ipv6 那行用 # 注释掉

打开文件 /etc/modprobe.d/blacklist

加入一行 blacklist ipv6

重启

在terminal输入命令行: ip a | grep inet6



3.双网卡问题



sudo ifconfig eth1 down 或者 up

sudo ifconfig eth0 up 或者 down

sudo dhclient



4.终极解决方案



1.sudo gedit /etc/ppp/peers/dsl-provider

复制一下代码,替换原先的:



# Configuration file for PPP, using PPP over Ethernet

# to connect to a DSL provider.

#

# See the manual page pppd(Cool for information on all the options.



##

# Section 1

#

# Stuff to configure…



# MUST CHANGE: Uncomment the following line, replacing the user@provider.net

# by the DSL user name given to your by your DSL provider.

# (There should be a matching entry in /etc/ppp/pap-secrets with the password.)

#user myusername@myprovider.net



# Use the pppoe program to send the ppp packets over the Ethernet link

# This line should work fine if this computer is the only one accessing

# the Internet through this DSL connection. This is the right line to use

# for most people.

#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452"



# An even more conservative version of the previous line, if things

# don’t work using -m 1452…

#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1412"



# If the computer connected to the Internet using pppoe is not being used

# by other computers as a gateway to the Internet, you can try the following

# line instead, for a small gain in speed:

#pty "/usr/sbin/pppoe -I eth0 -T 80"





# The following two options should work fine for most DSL users.



# Assumes that your IP address is allocated dynamically

# by your DSL provider…

noipdefault

# Try to get the name server addresses from the ISP.

usepeerdns

# Use this connection as the default route.

# Comment out if you already have the correct default route installed.

defaultroute



##

# Section 2

#

# Uncomment if your DSL provider charges by minute connected

# and you want to use demand-dialing.

#

# Disconnect after 300 seconds (5 minutes) of idle time.



#demand

#idle 300



##

# Section 3

#

# You shouldn’t need to change these options…



hide-password

lcp-echo-interval 20

lcp-echo-failure 3

# Override any connect script that may have been set in /etc/ppp/options.

connect /bin/true

noauth

persist

mtu 1492



# RFC 2516, paragraph 7 mandates that the following options MUST NOT be

# requested and MUST be rejected if requested by the peer:

# Address-and-Control-Field-Compression (ACFC)

noaccomp

# Asynchronous-Control-Character-Map (ACCM)

default-asyncmap



plugin rp-pppoe.so eth0







# Configuration file for PPP, using PPP over Ethernet

# to connect to a DSL provider.

#

# See the manual page pppd(Cool for information on all the options.



##

# Section 1

#

# Stuff to configure…



# MUST CHANGE: Uncomment the following line, replacing the user@provider.net

# by the DSL user name given to your by your DSL provider.

# (There should be a matching entry in /etc/ppp/pap-secrets with the password.)

#user myusername@myprovider.net



# Use the pppoe program to send the ppp packets over the Ethernet link

# This line should work fine if this computer is the only one accessing

# the Internet through this DSL connection. This is the right line to use

# for most people.

#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1452"



# An even more conservative version of the previous line, if things

# don’t work using -m 1452…

#pty "/usr/sbin/pppoe -I eth0 -T 80 -m 1412"



# If the computer connected to the Internet using pppoe is not being used

# by other computers as a gateway to the Internet, you can try the following

# line instead, for a small gain in speed:

#pty "/usr/sbin/pppoe -I eth0 -T 80"





# The following two options should work fine for most DSL users.



# Assumes that your IP address is allocated dynamically

# by your DSL provider…

noipdefault

# Try to get the name server addresses from the ISP.

usepeerdns

# Use this connection as the default route.

# Comment out if you already have the correct default route installed.

defaultroute



##

此条目发表在 Uncategorized 分类目录,贴了 , 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已被标记为 *

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>