将原来的ubuntu虚拟机文件迁移到还有一台机子之后。

ifconfig显示仅仅有一个lo网卡,网上找了一些文章。大多是改动/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

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet dhcp

# #######################################################

将eth0改为静态ip

# #######################################################

# 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

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 192.168.60.218

gateway 192.168.60.1

netmask 255.255.255.0

# #######################################################

reboot后运行ifconfig,仍然仅仅显示lo。找不到eth0

无意中运行ifconfig -a,显示有eth1,eth2和lo。

于是改动/etc/network/interfaces,将原来的eth0改动为eth1

# #######################################################

# 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

iface lo inet loopback

# The primary network interface

auto eth1

iface eth1 inet static

address 192.168.60.218

gateway 192.168.60.1

netmask 255.255.255.0

# #######################################################

reboot后,ifconfig最终显示eth1,熟悉的网络又回来了。这里简单记录一下,以免下次再次遇到。



最新文章

  1. js的scroll详解
  2. PHPExcel导出数据
  3. java服务器知识
  4. 《Concrete Mathematics》-chaper5-二项式系数
  5. Strategic game(POJ 1463 树形DP)
  6. appsettings.json
  7. 开心菜鸟系列学习笔记------javascript(4)
  8. jsoncpp 不能处理long类型数据
  9. 蓝桥网试题 java 基础练习 特殊回文数
  10. 数字图像处理界标准图像 Lena 后面的故事
  11. iOS(12) ANCS链接问题(用Android 9.0设备链接)
  12. 抛弃配置后的Spring终极教程
  13. /proc详解
  14. 如何用JQuery实现单元格 循环变背景色
  15. php 有意思的小题
  16. MVC Autofac依赖注入
  17. php5.3 php-fpm 开启 关闭 重启
  18. 在Kubernetes集群里安装微服务DevOps平台fabric8
  19. C++ union使用注意
  20. C#语言-03.逻辑控制语句

热门文章

  1. odd number、 even number
  2. Longest Substring Without Repeating Characters 最长不重复子串
  3. php排序算法之选择排序
  4. shu_1186 字符排列问题
  5. 我的第一个html计算器
  6. math方法集合
  7. Swift和Objective-C的差异性
  8. Spring-----事务配置的五种方式
  9. Android 判断当前设备是否联网
  10. 【原】YUI3:js加载过程及时序问题