配置linux box有一个静态ip

发布于 2024-09-09 10:41:16 字数 1459 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那一片橙海, 2024-09-16 10:41:16

你的路由器可能正在运行 dhcp 服务器,所以你应该将你的 linux 盒子设置为一个不在你的路由器 dhcp 范围内的 IP。

有关如何为 debian 设置静态 IP 的信息,请参阅 man Interfaces

问候

your router is probably running a dhcp server, so you should set your linux box to an ip which is not covered by the dhcp range of your router.

See man interfaces for information about how to set the static ip for your debian.

Regards

绝對不後悔。 2024-09-16 10:41:16

是的,您可以让您的 PC 使用静态 IP,而网络的其余部分保留在 DHCP 上

我正在运行 Ubuntu Lucid (10.04)

2 个选项

  1. System->Preferences->NetworkConnection 然后将 eth0 设置 ipv4 编辑为手动并设置适当的设置。
  2. 手动编辑/etc/network/interfaces文件,我添加了以下内容

auto eth0

iface eth0 inet static

address 192.168.0.7

netmask 255.255.255.0

network 192.168.0.0

Broadcast 192.168.0.255

gateway 192.168.0.1

Yes you can make your PC use a static ip while the rest of the network remains on DHCP

I'm Running Ubuntu Lucid (10.04)

2 options

  1. System->Preferences->NetworkConnection then editing the eth0 setting ipv4 to manual and set appropriate settings.
  2. manually edit the /etc/network/interfaces file, I added the following

auto eth0

iface eth0 inet static

address 192.168.0.7

netmask 255.255.255.0

network 192.168.0.0

broadcast 192.168.0.255

gateway 192.168.0.1

夏夜暖风 2024-09-16 10:41:16

大多数路由器都可以选择将静态 IP 分配给 MAC 地址。让你的Linux机器使用dhcp。登录路由器设置页面。应该有一个设置页面来将静态 IP 分配给给定的 MAC 地址。这在 Linksys 路由器上可用。如果您不支持,请查看是否可以使用 dd-wrt/open-wrt/tomato 刷新您的路由器。这些固件肯定支持此功能。

如果您仍然想配置 Linux 客户端而不是路由器,我建议您选择最高的第四个四元数。除非网络上有这么多盒子,否则路由器不会使用该 IP。

Most of the routers have option to assign static ip to a mac addres. Let you Linux box on dhcp. Log on to router setting page. There should be a setting page to assign static ip to a given MAC address. This is available on Linksys router. If your doesn't support than see if you can flash your router with dd-wrt/open-wrt/tomato. these firmware definatly support this feature.

If you still want to configure you Linux client and not the router than i suggest you pick the highest fourth quad number. Router will not use that ip unless you have so many box on the network.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文