zoukankan      html  css  js  c++  java
  • ubuntu下修改ip重启系统ip不变

      今天同学问我ubuntu下ip如何写死,我想起这周在公司我们队长也问过我,我就在这把我实验的方法说一下、

    打开终端:

    sudo vim /etc/network/interfaces

    然后按如下修改:

    auto eth0      ------------------------eth0,根据自己已有的修改。用ifconfig查看。

    iface eth0 inet static      ---------------------eth0根据已有修改  

      address 192.168.18.2         ------------写自己的ip

      netmask 255.255.255.0  ------------不用修改

          network 192.168.18.0   ------------根据自己的ip修改

          gateway  192.168.18.1  -------------根据自己的ip修改

    auto eth1

    iface eth1 inet static        

    address 172.17.94.93        

    netmask 255.255.255.0        

    broadcast 172.17.94.255        

    gateway 172.17.94.254

    然后保存退出、。

    source /etc/network/interfaces ------------让修改的配置文件生效、

    sudo /etc/init.d/networking restart   重启网络

  • 相关阅读:
    匈牙利算法-二分图的最大匹配
    UOJ 407(IOI2018 D1T3)
    UOJ 460
    UOJ 405(IOI2018 D1T1)
    Codeforces 1110E
    2.文件结构
    1.常用快捷键
    Python3.x和Python2.x的差异
    javascript 常用内置对象
    94. Binary Tree Inorder Traversal(非递归实现二叉树的中序遍历)
  • 原文地址:https://www.cnblogs.com/shanchen/p/3379600.html
Copyright © 2011-2022 走看看