当前位置:才华咖 > 互联网计算机 > 计算机 > 操作系统 > Ubuntu Linux系统下设置Static IP的方法
手机版

Ubuntu Linux系统下设置Static IP的方法

来源:才华咖 阅读:1.9W 次

Ubuntu的网络参数保存在文件 /etc/network/interfaces中,默认设置使用dhcp,内容如下:

Ubuntu Linux系统下设置Static IP的方法

# The primary network interface

auto eth0

iface eth0 inet dhcp

设置静态ip的'方法如下:

(1)编辑 /etc/network/interfaces

1.1)将dhcp 一行屏蔽

# The primary network interface

auto eth0

#iface eth0 inet dhcp

1.2)添加和静态ip有关的参数

# The primary network interface

iface eth0 inet static

address

netmask

gateway

(2)编辑 /etc/,设置dns

nameserver

nameserver

(3)执行下面两个命令,启用新设置

$sudo ifdown eth0

$sudo ifup eth0

本文链接:https://www.caihuaka.com/jsjzs/caozuo/pdvn1.html

Copyright © 2024. 才华咖 All right reserved. 浙ICP备20120231号-3

文字美图素材,版权属于原作者。部分文章内容由网友提供推送时因种种原因未能与原作者联系上,若涉及版权问题,敬请原作者联系我们,立即处理。