ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

包含网卡/无线网的网络问题和ADSL/校园网/宽带拨号支持及代理/共享等网络使用问题
回复
hitmz
帖子: 1
注册时间: 2012-12-14 22:58
系统: ubuntu

ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#1

帖子 hitmz »

希望大神的详细说明 用mentohust 可以认证 但就是获取IP之类的 失败 上不了网
sasika
帖子: 47
注册时间: 2009-07-16 15:16

Re: ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#2

帖子 sasika »

$ cat /etc/network/interfaces

auto lo
iface lo inet loopback

# 有线网卡
auto eth0
iface eth0 inet static
# IP 地址
address xxx.xxx.xxx.xxx
# 子网掩码
netmask 255.255.255.0
# 网关
gateway xxx.xxx.xxx.xxx

再 重启网卡
$ sudo ifdown eth0
$ sudo ifup eth0
ifconfig 可以看到结果了
头像
kuangquanshuili
帖子: 57
注册时间: 2011-11-03 17:51

Re: ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#3

帖子 kuangquanshuili »

楼上正解。 :em01
www.3gegg.com、www.paiziwang.com、www.shumeipai.net、www.52bazhong.com
shepherd_M
帖子: 35
注册时间: 2012-12-22 15:34
系统: Ubuntu12.04

Re: ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#4

帖子 shepherd_M »

sasika 写了:
$ cat /etc/network/interfaces

auto lo
iface lo inet loopback

# 有线网卡
auto eth0
iface eth0 inet static
# IP 地址
address xxx.xxx.xxx.xxx
# 子网掩码
netmask 255.255.255.0
# 网关
gateway xxx.xxx.xxx.xxx
再 重启网卡
$ sudo ifdown eth0
$ sudo ifup eth0
ifconfig 可以看到结果了
但是为什么会成这样?

mzf@mzf-Aspire-5552G:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

mzf@mzf-Aspire-5552G:~$ auto lo
No command 'auto' found, did you mean:
Command 'uuto' from package 'uucp' (universe)
auto: command not found
mzf@mzf-Aspire-5552G:~$ iface lo inet loopback
iface: command not found
mzf@mzf-Aspire-5552G:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

mzf@mzf-Aspire-5552G:~$
mzf@mzf-Aspire-5552G:~$
mzf@mzf-Aspire-5552G:~$ # 有线网卡
mzf@mzf-Aspire-5552G:~$ auto eth0
No command 'auto' found, did you mean:
Command 'uuto' from package 'uucp' (universe)
auto: command not found
mzf@mzf-Aspire-5552G:~$ iface eth0 inet static
iface: command not found
mzf@mzf-Aspire-5552G:~$ # IP 地址
mzf@mzf-Aspire-5552G:~$ address 218.197.215.254
No command 'address' found, did you mean:
Command 'naddress' from package 'util-vserver' (universe)
address: command not found
mzf@mzf-Aspire-5552G:~$ # 子网掩码
mzf@mzf-Aspire-5552G:~$ netmask 255.255.255.0
255.255.255.0/32
mzf@mzf-Aspire-5552G:~$ # 网关
mzf@mzf-Aspire-5552G:~$ gateway 218.197.215.254
gateway: command not found
mzf@mzf-Aspire-5552G:~$
sasika
帖子: 47
注册时间: 2009-07-16 15:16

Re: ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#5

帖子 sasika »

shepherd_M,
呃 /etc/network/interfaces 是一个文件 直接修改它就好了
我只是用 cat 来显示一下设置成静态IP时它可以是什么样子的……
:em02

你可以自己用喜欢的(文本)编辑器修改的
xiap
帖子: 2
注册时间: 2012-11-10 8:44
系统: ubuntu12.10+windows8

Re: ubuntu 12.04上校园网 说是要设置静态IP 什么的 怎么设置啊?

#6

帖子 xiap »

右上角的数据连接,编辑连接,添加,ipv4方法手动,添加学校给你的地址子网掩码网关ip等等,就ok了。我用的是校园网ubuntu12.10lts
回复