如何为Ubuntu 10.04台式计算机分配静态IP

If you have a home network with several computers, assigning them static IP addresses can make troubleshooting easier. Today we take a look at switching from DHCP to a static IP in Ubuntu.

如果您的家庭网络中有多台计算机,则为它们分配静态IP地址可以使故障排除更加容易。 今天,我们来看看在Ubuntu中从DHCP切换到静态IP的过程。

Assign a Static IP

分配静态IP

Using Static IPs prevents address conflicts between machines and can allow easier access to them. If you have a small home network and are satisfied with the machines getting their IP address automatically via DHCP, there won’t be anything gained by using static addresses.

使用静态IP可以防止计算机之间的地址冲突,并可以更轻松地访问它们。 如果您的家庭网络很小,并且对通过DHCP自动获取IP地址的计算机感到满意,那么使用静态地址将不会有任何好处。

Using Static IPs isn’t necessarily for the average user, but if you’re a geek who wants to know the address assigned to each machine, it can allow for faster troubleshooting. 

普通用户不一定要使用静态IP,但是如果您是一个极客,希望知道分配给每台计算机的地址,则可以更快地进行故障排除。

To change your Ubuntu machine to a Static IP go to System \ Preferences \ Network Connections.

要将Ubuntu计算机更改为静态IP,请转到系统\首选项\网络连接。

1whslinux2

In our example, we’re on a wired system so click on the Wired tab, then select Auto eth0 and click on Edit.

在我们的示例中,我们使用的是有线系统,因此单击“有线”选项卡,然后选择“自动eth0”并单击“编辑”。

2connectserver2

Select the IPv4 settings tab, change Method to Manual, click the Add button. Then type in the Static IP Address, Subnet Mask, DNS Servers, and Default Gateway. Then click Apply when you’re finished.

选择“ IPv4设置”选项卡,将“方法”更改为“手动”,然后单击“添加”按钮。 然后键入“静态IP地址”,“子网掩码”,“ DNS服务器”和“默认网关”。 完成后,单击“应用”。

Make sure to hit Enter after typing in the Default Gateway otherwise it will revert back to 0.0.0.0

输入默认网关后,请确保按Enter键,否则它将恢复为0.0.0.0。

3staticip[3]

You’ll need to enter in your admin password before the changes go into affect.

在更改生效之前,您需要输入管理员密码。

4static2

To verify the changes have been made successfully launch a Terminal session and type in ifconfig at the command prompt, or follow these directions. You also might want to ping the address from another machine to make sure everything is communicating.

要验证是否已成功进行更改,请启动终端会话,然后在命令提示符下键入ifconfig ,或按照以下说明进行操作 。 您可能还想从另一台计算机ping地址,以确保一切正常。

sshot-2010-06-10-[00-52-30][2]

If you want to assign a Static IP to your Windows machines, check out our article on how to assign a Static IP on Windows systems (make sure to browse the comments as our readers have some good suggestions). 

如果要为Windows机器分配静态IP,请查看有关如何在Windows系统上分配静态IP的文章(请确保浏览注释,因为我们的读者有很好的建议)。

Whether you have a small office or home network set up with a server and several machines, using a Static IP on each device can help you manage them easily. Again, it isn’t for everyone as it really depends on how your network is setup and the way you use it.

无论您是通过服务器还是多台计算机来安装小型办公室或家庭网络,在每台设备上使用静态IP都可以帮助您轻松管理它们。 同样,它并不适合所有人,因为它实际上取决于网络的设置方式和使用方式。

翻译自: https://www.howtogeek.com/howto/19541/how-to-assign-a-static-ip-to-an-ubuntu-10.04-desktop-computer/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值