个人工具

联网

来自Ubuntu中文

Qiii2006讨论 | 贡献2010年8月1日 (日) 11:34的版本 ifconfig

跳转至: 导航, 搜索

基础知识

Ubuntu 中,通常有线网卡为eth0,无线网卡则为wlan0,后续增加的以此类推(可能某些无线网卡型号命名为eth1,而非wlan0)。

DNS解析

root@ubuntu:~# cat /etc/resolv.conf
nameserver 8.8.8.8 
nameserver 8.8.4.4
domain domain
search domain
8.8.8.8
8.8.4.4

这是 Google 公共 DNS。

hosts

root@ubuntu:~# cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       ubuntu.ubuntu-domain    ubuntu

192.168.0.251 web1.example.com web1

192.168.0.252 web2.example.com web2

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

用于本地解析域名,比前面那个优先级更高。

ifconfig简介

ifconfig 是一个用来查看、配置、启用或禁用网络接口的工具,这个工具极为常用的(说的是喜欢动命令的人……)。

查看系统网卡信息

ifconfig

激活/禁用网卡

激活无线网卡

sudo ifconfig 网卡设备名 up

查看无线网卡信息

ifconfig 网卡设备名

启用/禁用网络

sudo /etc/init.d/networking start

iwconfig

用于查看无线连接情况

qii@ubuntu:~$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

有线网络

pppoeconf

命令行工具,只适用于ADSL拨号。

sudo pppoeconf

通吃有线、无线

Network Manager(GNOME)

Kubuntunm.png
sudo apt-get install network-manager-gnome

随后只要将下列命令放到自动启动便可,--sm-disable option 选项用于防止多个nm-applet同时运行。

nm-applet --sm-disable   

Wicd

sudo apt-get install wicd
wicd-gtk 

只吃无线网络

WiFi Rader

sudo apt-get install wifi-radar
sudo wifi-radar