Ubuntu网卡配置

1、通过命令直接配置

sudo ifconfig eth0 IP地址 netmask 子网掩码------配置IP地

sudo route add default gw 网关------------添加默认路由

vi /etc/resolv.conf 配置文件 添加nameserver DNS----配置DNS

sudo /etc/init.d/networking restart-----------重启网卡配置
但是方式只能临时修改,当服务器重启后,配置信息丢失;第二种方式直接修改配置文件,重启服务器后配置信息不会丢失;

2、直接修改配置文件

Ubuntu 系统配置文件在:/etc/network/interfaces
编辑配置文件:sudo vi /etc/network/interfaces
并用下面的行来替换有关eth0的行:
# The primary network interface
auto eth0
iface eth0 inet static
address IP地址
gateway 网关
netmask 子网掩码
#network 192.168.2.0
#broadcast 192.168.2.255

根据你的情况填上所有诸如address,netmask,network,broadcast和gateways等信息:
sudo /etc/init.d/networking restart--重启网卡;使之配置生效

配置IP地址后,需要配置DNS;具体方式如下;

sudo vi //etc/resolv.conf  
search chotim.com
nameserver DNS服务器地址
sudo /etc/init.d/networking restart--重启网卡服务即可

时间: 2024-08-02 10:46:46

Ubuntu网卡配置的相关文章

Windows7下用VirtualBox安装Ubuntu网卡配置

Win7下用VirtualBox安装Ubuntu,要求Ubuntu能连上互联网,同时在Ubuntu中配置SSH.FTP.NFS服务,能从Win7进行访问. 此时Linux虚拟机需要两块网卡,一块使用NAT方式(网络地址翻译网络)连接,用于连接互联网: 另一块设置为网桥网络(Bridged),用于建立SSH.FTP.NFS连接,要求所有机器(Linux主机网卡IP和Win7网卡IP)应处于同一网段,如192.168.0.x,子网掩码255.255.255.0 NAT方式连接的网卡,使用默认设置即可

【转】Ubuntu网卡配置

一.网卡地址配置Ubuntu的网络配置文件是:/etc/network/interfaces1.以DHCP 方式配置网卡   auto eth0   iface eth0 inet dhcp用sudo /etc/init.d/networking restart命令使网络设置生效 2.为网卡配置静态IP地址sudo vi /etc/network/interfacesauto eth0iface eth0 inet staticaddress 192.168.1.100netmask 255.2

Ubuntu 网卡配置或网卡设备未托管拯救方法

Ubuntu 网络配置 debian/ubuntu管理网络连接的有两套方案,右上角的图形化的NetworkManager和配置文件的 ifup/ifdown, 如果在 /etc/network/interfaces里设置了网卡信息,那么NetworkManager就不会接管该网卡, 如果没有设置配置文件NetworkManager默认是会接管网卡的,但有时可能会出现图形化管理挂掉的情况, 图形化管理工具显示设备未托管,出现这种情况可通过设置配置文件的方案拉起网卡. 修改配置文件,使配置文件方案生

ubuntu 网卡配置

1.配置文件所在路径:/etc/network/interfaces 2.需要的配置项如下:

Ubuntu 为网卡配置静态IP地址

为网卡配置静态IP地址编辑文件/etc/network/interfaces:sudo vi /etc/network/interfaces并用下面的行来替换有关eth0的行:# The primary network interfaceauto eth0iface eth0 inet staticaddress 192.168.2.1gateway 192.168.2.254netmask 255.255.255.0#network 192.168.2.0#broadcast 192.168.

Ubuntu静态IP Ubuntu上网配置方法

1. 执行代码 vim /etc/network/interfaces 2. 编辑内容 auto lo iface lo inet loopback      #网卡eth0的配置    auto eth0   iface eth0 inet static   address 192.168.1.30 #设置得静态IP   netmask 255.255.255.0   gateway 192.168.1.1   #dns-nameservers 8.8.8.8   #network 192.1

CentOS Ubuntu网络配置

CentOS网络配置 开启网络功能#vi /etc/sysconfig/network重要参数:        NETWORKING=yes            要不要有网络        NETWORKING_IPV6=no        是否支持 IPv6        HOSTNAME=主机名 网卡的配置文件 相关的网络配置文件和目录:    /etc/sysconfig/network-scripts/        存放网卡的配置文件的目录    以/etc/sysconfig/ne

ubuntu 命令配置ip 网关 dns

如果是在虚拟机中使用Ubuntu,先设置好主机的网络,然后配置虚拟机Ubuntu的IP和网关 如果主机操作系统就是Ubuntu,请直接参照下文进行设置 内容如下: 1. 检验是否可以连通,就使用ping命令ping 网关 开始的时候总是现实unreachable 2. 设置IP sudo ifconfig eth0 133.133.133.190 netmask 255.255.255.0 这样就算设置好了网卡eth0的IP地址和子网掩码 3. 设置网关 sudo route add defau

linux 网络设备,网卡配置 ,相关

网络设备,网卡配置: Eth0是物理网卡:唯一mac地址,Bcast:广播地址,MAsk:子网掩码, Lo:系统自带的回环的ip地址,可以做一些基本的测试应用,比如没有网卡就用127.0.0.1, [email protected]:/# ifconfig ens33 down (停掉某个网卡,重启操作系统可以起起来) [email protected]:/# ifconfig ens33 up (启动某个网卡) [email protected]:/# ifconfig ens33 192.1