网络配置

静态IP

root@ubuntu:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet static
    address 10.0.0.50
    netmask 255.255.255.0
    network 10.0.0.0
    broadcast 10.0.0.255
    gateway 10.0.0.2
    # dns-* options are implemented by the resolvconf package, if installed
    dns-nameservers 10.0.0.

DHCP动态IP

以DHCP方式配置网卡

编辑文件vi /etc/network/interfaces

并用下面的行来替换有关eth0的行:
# The primary network interface - use DHCP to find our address
auto eth0
iface eth0 inet dhcp

用下面的命令使网络设置生效

/etc/init.d/networking restart

设置主机名称(hostname)

使用下面的命令来设置当前主机的主机名称:

vim /bin/hostname

newname系统启动时,它会从/etc/hostname来读取主机的名称.

 配置DNS

vim /etc/resolv.conf

Ubuntu系统-网络配置的更多相关文章

  1. Linux 系统 网络配置

    Linux 系统 网络配置 配置Linux系统网络的方法有几种,这里介绍本人常用的两种. 第一种:使用命令ifconfig配置,具体用法:Ipconfig  ethx   x.x.x.x    net ...

  2. Ubuntu server 网络配置中遇到的问题

    Ubuntu server 网络配置中遇到的问题 图片中ip地址有可能和文字不符,请不要在意太多,知道原理即可 - 1.首先就是要配置ip地址 vim /etc/network/interfaces ...

  3. Ubuntu Core 网络配置

    /********************************************************************************* * Ubuntu Core 网络配 ...

  4. 清空windows系统网络配置

    清空windows系统网络配置 来源  https://www.cnblogs.com/lemon-rain/p/9569990.html 具体描述:qq,微信可用网,但其他不能用. 一.win+r ...

  5. win10 下使用虚拟机安装ubuntu及其网络配置

    通过虚拟机安装ubuntu 我的机器是64位的win10系统,使用的虚拟机VMware workstation 12 pro 安装的是ubuntu 14.04, 网上教程很多,很详细也有有效 win1 ...

  6. Ubuntu中网络配置interfaces与界面网络配置NetworkManager

    [Server版本] 在Ubuntu Server版本中,因为只存有命令行模式,所以要想进行网络参数设置,只能通过修改 /etc/network/interfaces .具体设置方法如下: (1) U ...

  7. [Linux][VMWare] 学习笔记之安装Linux系统-网络配置

    最近开始折腾Linux,在本机装了个VMWare和Centos,装完之后虚拟机里面的OS可以上网,但是使用SecureCRT连接不上虚拟机,开始折腾这个网络. vmware安装好以后,会自动添加两张网 ...

  8. Ubuntu系统下配置IP地址方法介绍

    配置IP方式有两种: 1.通过命令直接配置 sudo ifconfig eth0 IP地址 netmask 子网掩码------配置IP地 sudo route add default gw 网关-- ...

  9. ubuntu/centos网络配置

    UBUNTU网络配置 配置临时的Ip ifconfig eth0 其中24指的网络掩码24位. vim /etc/network/interfaces 添加下面内容 auto eth0 #开机自动连接 ...

随机推荐

  1. 09-hibernate单表操作(1)

    1,单一主键 2,基本类型 3,对象类型 4,组件属性 5,单表操作 单一主键 常用生成策略: assigned 有程序员生成(手工) native 由数据库底层,如果是mysql是increment ...

  2. Nuget使用规范

  3. postman--- form-data、x-www-form-urlencoded、raw、binary分别如何设置

    转自:http://blog.csdn.net/wangjun5159/article/details/47781443 1.form-data:  就是http请求中的multipart/form- ...

  4. python selenium --调用js

    转自:http://www.cnblogs.com/fnng/p/3230768.html 本节重点: 调用js方法 execute_script(script, *args) 在当前窗口/框架 同步 ...

  5. Lintcode---验证二叉查找树

    给定一个二叉树,判断它是否是合法的二叉查找树(BST) 一棵BST定义为: 节点的左子树中的值要严格小于该节点的值. 节点的右子树中的值要严格大于该节点的值. 左右子树也必须是二叉查找树. 一个节点的 ...

  6. Lintcode---统计比给定整数小的数的个数

    给定一个整数数组 (下标由 0 到 n-1,其中 n 表示数组的规模,数值范围由 0 到 10000),以及一个 查询列表.对于每一个查询,将会给你一个整数,请你返回该数组中小于给定整数的元素的数量. ...

  7. Current thread must be set to single thread apartment (STA) mode before OLE,当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“8856f961-340a-11d0-a96b-00c04fd705a2”。

    Add the STAThreadAttribute attribute on the Main method. This attribute is required if your program ...

  8. unity, OnTriggerEnter2D不触发

    我两个物体A,B都添加了Circle Collider 2D,并且都勾选了is Trigger,我在A的脚本里用void OnTriggerEnter2D(Collider2D coll)检测碰撞,但 ...

  9. JS prototype 属性

    String.prototype.trim=function(){ return this.replace(/(^\s*)|(\s*$)/g, "");}

  10. 点滴积累【JS】---JS小功能(onmousemove鼠标移动坐标接龙DIV)

    效果: 思路: 利用onmousemove事件,然后获取鼠标的坐标,之后把DIV挨个遍历,最后把鼠标的坐标赋给DIV. 代码: <head runat="server"> ...