zoukankan      html  css  js  c++  java
  • ubuntu16 和ubuntu18安装及设置静态ip

    1、准备ubuntu16镜像
    2、安装:https://zhuanlan.zhihu.com/p/144704865
    3、安装ubuntu后,sudo passwd root这个命令建立root用户的密码
    4、更新apt-get:apt-get -y update
    5、设置静态ip:
        5.1、ifconfig查看网卡名称
        5.2、修改网卡配置文件sudo  vim /etc/network/interfaces
            # auto ens33
            # iface ens33 inet dhcp
            auto ens33
            iface ens33 inet static
            address 192.168.0.10
            netmask 255.255.255.0
            gateway 192.168.0.1
        5.3、修改NDS配置
            sudo vim /etc/resolvconf/resolv.conf.d/head
                nameserver 8.8.8.8
        5.4、重启网络服务 $ sudo /etc/init.d/networking restart
        5.5、重启
        5.6、(可选)安装ssh:sudo apt-get install openssh-server






    1、准备ubuntu18镜像
    2、安装:https://zhuanlan.zhihu.com/p/144704865
    3、安装ubuntu后,sudo passwd root这个命令建立root用户的密码
    4、更新apt-get:apt-get -y update
    apt-get install net-tools
    5、设置静态ip:
        5.1、ifconfig查看网卡名称
        5.2、修改网卡配置文件vim /etc/netplan/01.....
            network:
            version: 2
            renderer: NetworkManager
            ethernets:
             enp3s0: #配置的网卡名称,使用ifconfig -a查看得到
               dhcp4: no #dhcp4关闭
               addresses: [192.168.0.10/24] #设置本机IP及掩码
               gateway4: 192.168.0.1 #设置网关
               nameservers:
                 addresses: [8.8.8.8] #设置DNS
        5.3、静态ip生效
            sudo netplan apply
        5.4、解决resolv.conf配置文件被覆盖
            apt-get install resolvconf
            cd /etc/resolvconf/resolv.conf.d/
            vim base
            添加:
                nameserver 8.8.8.8
                nameserver 8.8.4.4
            reboot

  • 相关阅读:
    php 转化整型需要注意的地方
    生成6位随机数
    php://input
    ios常见问题 经验之谈
    ios 从前台返回到回台 从后台返回到前台 或者 支付宝支付订单后 对界面进行操作
    ios根据文本自适应 然后 搭建类似如下效果
    iosTableView 局部全部刷新以及删除编辑操作
    ios打开系统自带APP
    iOS通过URL Scheme启动app(收集了常用的app的URL Scheme)
    ios UIApplocation 中APP启动方式
  • 原文地址:https://www.cnblogs.com/yangyangming/p/15673222.html
Copyright © 2011-2022 走看看