ubuntu配置网络
来源:互联网 发布:超市管理系统c语言 编辑:程序博客网 时间:2024/05/16 14:06
方式1:网卡通过DHCP自动获取IP地址
$ sudo gedit /etc/network/interfaces
# 修改文件/etc/network/interfaces如下文
#-------------------------------------------------------------------------------
# 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 # 开机自动激lo接口
iface lo inet loopback # 配置lo接口为环回口
# The primary network interface (配置主网络接口)
auto eth0 #开机自动激活eth0接口
iface eth0 inet dhcp #配置eth0接口为DHCP自动获取
#-------------------------------------------------------------------------------
$ sudo /etc/init.d/networking restart # 重启网络
方式2:网卡静态分配IP地址
$ sudo gedit /etc/network/interfaces
# 修改文件/etc/network/interfaces如下文
#-------------------------------------------------------------------------------
# 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 # 开机自动激lo接口
iface lo inet loopback # 配置lo接口为环回口
# The primary network interface (配置主网络接口)
auto eth0 #开机自动激活eth0接口
iface eth0 inet static #配置eth0接口为静态设置IP地址
address 10.16.3.99
netmask 255.255.255.0
network 10.16.3.0
broadcast 10.16.3.255
gateway 10.16.3.1
####################################################
## dns-* options are implemented by the resolvconf package, if installed(DNS设置)
#dns-nameservers 61.153.177.196 61.153.177.197
#dns-search fireteam.org
####################################################
#sudo gedit /etc/resolv.conf
##设置DNS server(可以设置多个)
#nameserver 192.168.1.1
####################################################
#-------------------------------------------------------------------------------
$ sudo /etc/init.d/networking restart # 重启网络
$ sudo gedit /etc/network/interfaces
# 修改文件/etc/network/interfaces如下文
#-------------------------------------------------------------------------------
# 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 # 开机自动激lo接口
iface lo inet loopback # 配置lo接口为环回口
# The primary network interface (配置主网络接口)
auto eth0 #开机自动激活eth0接口
iface eth0 inet dhcp #配置eth0接口为DHCP自动获取
#-------------------------------------------------------------------------------
$ sudo /etc/init.d/networking restart # 重启网络
方式2:网卡静态分配IP地址
$ sudo gedit /etc/network/interfaces
# 修改文件/etc/network/interfaces如下文
#-------------------------------------------------------------------------------
# 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 # 开机自动激lo接口
iface lo inet loopback # 配置lo接口为环回口
# The primary network interface (配置主网络接口)
auto eth0 #开机自动激活eth0接口
iface eth0 inet static #配置eth0接口为静态设置IP地址
address 10.16.3.99
netmask 255.255.255.0
network 10.16.3.0
broadcast 10.16.3.255
gateway 10.16.3.1
####################################################
## dns-* options are implemented by the resolvconf package, if installed(DNS设置)
#dns-nameservers 61.153.177.196 61.153.177.197
#dns-search fireteam.org
####################################################
#sudo gedit /etc/resolv.conf
##设置DNS server(可以设置多个)
#nameserver 192.168.1.1
####################################################
#-------------------------------------------------------------------------------
$ sudo /etc/init.d/networking restart # 重启网络
- ubuntu 网络配置
- ubuntu 网络配置
- Ubuntu配置网络
- Ubuntu简单网络配置
- ubuntu linux网络配置
- ubuntu-网络配置
- Ubuntu Server 网络配置
- Ubuntu网络配置
- ubuntu配置网络
- Ubuntu - 修改网络配置
- Ubuntu有线网络配置
- ubuntu: 配置网络方法
- ubuntu网络配置
- Ubuntu网络配置命令
- Ubuntu 10.04 网络配置
- Ubuntu网络配置
- ubuntu网络连接配置
- ubuntu网络配置
- Ubuntu下使用USB转串口——识别串口
- 黑马程序员---4、字符串
- Sorting It All Out
- 电感知识
- 【详解php中const与define的异同】
- ubuntu配置网络
- TextView设置不可见
- 常用电子元件基础知识(图解)
- CodeForces MemSQL start[c]up Round 1 A题
- erlang lists模块函数使用大全
- Professoion Trouble shooting for Full filesystem
- 电子元件基础知识
- MySQL数据库引擎ISAM,myISAM,heap
- 翻转句子中单词的顺序-运用vector