ubuntu 外网 linux设置外网访问
大家好,关于ubuntu 外网很多朋友都还不太明白,今天小编就来为大家分享关于linux设置外网访问的知识,希望对各位有所帮助!
ubuntu能ping通网关,但不能ping通外网
下面我重新整理一下:
————————这是 ubuntu的配置:————————————
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.30.253
netmask 255.255.255.0
network 192.168.30.0
broadcast 192.168.30.255
gateway 192.168.30.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.30.254
———————这是xp的网络参数———————————————
Windows IP Configuration
Host Name............: lenovo
Primary Dns Suffix.......:
Node Type............: Unknown
IP Routing Enabled........: No
WINS Proxy Enabled........: No
Ethernet adapter本地连接:
Connection-specific DNS Suffix.:
Description...........: Realtek RTL8169/8110 Family Gigabit Ethernet NIC
Physical Address.........: 00-13-22-45-32-8A
Dhcp Enabled...........: No
IP Address............: 192.168.30.3
Subnet Mask...........: 255.255.255.0
Default Gateway.........: 192.168.30.254
DNS Servers...........: 202.103.44.150
————————————————————————————
二楼说的可能是正确的:网关或要ping的服备器对ping命令进行了屏蔽。
无论是在ubuntu还是xp中,ping外网的IP都是失败的!
但是我在xp下
C:\Documents and Settings\Administrator>telnet 119.147.15.13 25
却能得到服务器响应;
119.147.15.13是tencent的一个服务器地址,
telnet 119.147.15.13 25的含义是登录腾讯的 smtp
可我在ubuntu上执行同样的命令却得不到服务器的响应,我觉得ubuntu还是不能连接外网,请问各位高手怎么搞定啊???????
———————————————————————————————
{123.4.45.* 2010-4-29 12:55}*******的回答是对的,公司的网管把网关的ping给关了。
———————————————————————————————
———————————————————————————————
【 blackfriday13】
(buntu的dns没有设置对,需要在另外的地方配置的)*******我现在只想网通,对于的DNS的配置,我想在网通后再去设置;
(在XP界面能用putty控制ubuntu——由于是内网,所以不需要通过网关。)*******我对“网关”的理解是充当数据中转的中心结点可以称作网关,公司的192.168.30.222这个电脑既为内网间的电脑相互交换数据,又为内网电脑与外网提供链接;
(你不用把xp的ip用在ubuntu上,你只要把网关和dns弄对就可以了)*******有时候公司的一些IP能上,一些IP能上,我想尽量减少差异才这样做的;
(你提供的win和ubuntu的ip对照是不一样的,ubuntu里是192.168.30.1的网关及dns,而win里确是192.168.30.222的网关,dns是202.103.44.150)*******请见本栏提供的配置信息,上面的参数有误,会误导您的帮助!再次谢谢!
———————————————————————————————
ubuntu server18.04配置好ip却不能接通外网
ubuntu 18.04可以连接内网,无法连接外网
手动增加网关后,又重新sudo apt-get upgrade,提示/etc/resolvconf/resolv.conf.d更新时,选Y后,不用手动修改网关也可以连接外网了。
一切默认更新后,18.04LTS的图标问题也修复了。
得到的配置如下
$ cat/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND-- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run"systemd-resolve--status" to see details about the actual nameservers.
nameserver 127.0.0.53
search v01.net
options edns0
可以ping通内网,同时可以ping通8.8.8.8,114.114.114.114,但是ping外网失败,以下是手动增加网关的一个解决方法,如果还不行就需要查看其它方法了。
10.219.91.1要填你的网关
1. cat/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND-- YOUR CHANGES WILL BE OVERWRITTEN
2. route或netstat-rn,获取网关10.219.91.1
$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.219.91.1 0.0.0.0 UG 0 0 0 ens33
10.219.91.0* 255.255.255.0 U 0 0 0 ens33
link-local* 255.255.0.0 U 1000 0 0 ens33
3.修改/etc/resolvconf/resolv.conf.d/head,增加如下3行
nameserver 10.219.91.1
nameserver 114.114.114.114
nameserver 8.8.8.8
4.执行/etc/init.d/networking restart
5.查看/etc/resolv.conf
$ cat/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND-- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.219.91.1
nameserver 114.114.114.114
nameserver 8.8.8.8
6. ping Bing,显示成功
$ ping cn.bing.com
PING cn-0001.cn-msedge.net(202.89.233.100) 56(84) bytes of data.
64 bytes from 202.89.233.100: icmp_seq=1 ttl=115 time=40.9 ms
64 bytes from 202.89.233.100: icmp_seq=2 ttl=115 time=40.6 ms
64 bytes from 202.89.233.100: icmp_seq=3 ttl=115 time=51.4 ms
64 bytes from 202.89.233.100: icmp_seq=4 ttl=115 time=49.2 ms
/etc/udev/rules.d/
-rwxr-xr-x 1 root root 164 March 19 11:33 51-android.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
SUBSYSTEM=="usb",ATTRS{idVendor}=="1bc7",MODE="0666"
SUBSYSTEM=="usb",ATTRS{idVendor}=="2c7c",MODE="0666"
如何在ubuntu中通过校园网连接外网
1.校园网都有代理认证上网软件。有个上网认证客户端,这个是关键。
2.接下来就看你的ubuntu能不能安装这个上网认证客户端。不过ubuntu版本的是很少的。
3.所以,你需要用命令去安装(应该可以在ubuntu环境下,通过特殊方法,可以安装windows程序的),不过这个我没试过,我是将ubuntu安装在虚拟机,通过NAT,和宿主机共享上网的。
4.你可以在学校资源论坛找找,有认证客户端上网使用说明的,应该有关于linux上网操作方法的说明,或者问问网络管理员。
5.百度还是有用的,去搜索一下,很多这些方面的知识,你认真找的话,不难的,应该可以很快解决。