1. 查看虚拟机上本机ip
cmd→ipconfig

2. 配置网卡
2.1 备份原有配置文件配置文件
cp /etc/network/interfaces /etc/network/interfacesbak #备份原有配置文件
2.2 编辑interfaces
vim /etc/network/interfaces #编辑网卡配置文件

修改后,注意后面的地址要放在最后面

标注:

auto lo #开机自动连接网络

iface ens32 inet static #static表示使用固定ip,dhcp表述使用动态ip
address 192.168.21.166 #设置ip地址  【为ipconfig中地址一致,最后一位端口改前ping一下确定端口没人用】
netmask 255.255.255.0 #设置子网掩码
gateway 192.168.21.2 #设置网关

2.3 重启网卡

/etc/init.d/networking restart
3. 配置DNS
3.1 备份dns配置文件

cp /etc/resolv.conf /etc/resolv.confbak #备份原有dns配置文件
3.2 编辑配置文件

vim /etc/resolv.conf
3.3 编辑配置文件

注: nameserver:设置dns第一个为首选,第二个备用dns

注意dns和网关保持一致

3.4 重启网络

service networking restart # 重启网络

4. 验证
ip addr

看到ens32的地址通了。

ping 168.68.62.1
ping www.baidu.com
5. 使用git管理
安装SSH Server

在debian命令行下,输入$ sudo apt-get install ssh openssh-server即可安装SSH,安装完了SSH之后,我们就可以使用putty或xshell来连接虚拟机中的debian了。

服务器上打开虚拟机上101的镜像后,本机git中输入

$ ssh bimuser@168.68.62.101

nmcli -help

原文链接:https://blog.csdn.net/guigui_oy/article/details/80913526

debian 配置静态ip的更多相关文章

  1. linux (debian) 配置静态ip

    在局域网内使用动态ip分配,机器动态的获取 ip地址.可是我使用ssh登录的时候.总是断线. 后来发现,原来机器总是在两个ip地址192.168.2.203 和192.168.2.228之间切换.用s ...

  2. Ubuntu 14.04 配置静态IP

    命令行手工配置静态IP比较麻烦,记录于此备查. 1,ubuntu的网络配置文件在: # /etc/network/interfaces //这个文件里 2,默认安装时,网络配置是使用DHCP自动分配I ...

  3. centos7配置静态ip后仍然显示动态ip

    我在虚拟机上安装了CentOS7操作系统,将 /etc/sysconfig/network-scripts/ifcfg-eth0 文件配置静态 IP 为192.168.1.210,如图1: 然后我用 ...

  4. Linux:Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21...

    问题: Vmware安装linux虚拟机,桥接方式配置静态IP后重启网卡,提示:Error,some other host already uses address 10.252.252.21... ...

  5. Ubuntu 为网卡配置静态IP地址

    为网卡配置静态IP地址编辑文件/etc/network/interfaces:sudo vi /etc/network/interfaces并用下面的行来替换有关eth0的行:# The primar ...

  6. 关于ubuntu配置静态IP 无法正常上网的解决方案

    在ubuntu中配置静态IP后无法正常上网. 解决: 1.在终端执行 vim /etc/network/interfaces 在文件中加入如下内容,网关要写上,我开始一直无法上网就是因为没有配置网关 ...

  7. VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装

    VMware中安装CentOS7网络配置静态IP地址,常用配置和工具安装在阿里云开源镜像地址下载镜像Index of /centos/7.2.1511/isos/x86_64/http://mirro ...

  8. Ubuntu12.04配置静态ip地址

    Ubuntu12.04配置静态ip地址 $sudo gedit /etc/network/interfaces 原有内容只有如下两行: auto lo iface lo inet loopback 向 ...

  9. Linux配置静态IP

    在一块SSD的CentOS配置静态IP 1. 配置静态IP #vi /etc/sysconfig/network-scripts/ifcfg-eth0   DEVICE="eth0" ...

随机推荐

  1. Delphi主消息循环研究(Application.Run和Application.Initialize执行后的情况)

    Application.Initialize; Application.CreateForm(TForm1, Form1); Application.Run; 第一步,貌似什么都不做,但如果提前定义I ...

  2. Consul服务发现在windows下简单使用

    目录 基本介绍: 服务连接: 客户端: 系列章节: 回到顶部 基本介绍: 安装: 下载地址:https://www.consul.io/downloads.html 运行: consul agent ...

  3. WPF拖拽文件(拖入拖出),监控拖拽到哪个位置,类似百度网盘拖拽

    1.往wpf中拖文件 // xaml <Grid x:Name="grid_11" DragOver="Grid_11_DragOver" Drop=&q ...

  4. python Rabbitmq编程(一)

    python Rabbitmq编程(一) 实现最简单的队列通信 send端 #!/usr/bin/env python import pika credentials = pika.PlainCred ...

  5. 46. Permutations (JAVA)

    Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] O ...

  6. 内置json&pickle&shelve&xml

    序列化:把对象(变量)从内存中变成可存储可传输的过程称之为序列化,Python中叫做pickling,其他语言中也被称之为serialization,marshalling,flattening等等 ...

  7. 013-linux系统管理——系统资源查看

    linux系统管理——系统资源查看 ############# vmstat 命令 监控系统资源 ############# vmstat [刷新时间 刷新次数] [root@zabbix ~]# v ...

  8. Django【第6篇】:Django之ORM单表操作(增删改查)

    django之数据库表的单表查询 一.添加表记录 对于单表有两种方式 # 添加数据的两种方式 # 方式一:实例化对象就是一条表记录 Frank_obj = models.Student(name =& ...

  9. LeetCode--096--不同的二叉搜索树(python)

    我的思路比较low直接看官方题解吧... class Solution: def numTrees(self, n: int) -> int: G = [0] * (n+1) G[0],G[1] ...

  10. Git 使用的问题总结

    1.git stash pop 显示 xxx already exists, no checkout 当我们先使用 git stash save -u '保存信息说明' 来储藏更改,然后拉取代码 gi ...