我正在遵循本指南,https://help.ubuntu.com/community/XenProposed,我想设置一个静态 IP 地址,但我不知道该怎么做。我使用的是 12.04 服务器。
这是我遇到问题的步骤(我正在使用 eth1):
Edit /etc/network/interfaces, and make it look like this:
auto lo
iface lo inet loopback
auto xenbr0
iface xenbr0 inet dhcp
bridge_ports eth0
auto eth0
iface eth0 inet manual
我这样做了,下面是 ifconfig 的输出:
eth1 Link encap:Ethernet HWaddr 00:17:a4:f8:79:20
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:478264 errors:0 dropped:0 overruns:0 frame:0
TX packets:2895 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46470058 (46.4 MB) TX bytes:214620 (214.6 KB)
Interrupt:17 Memory:fa000000-fa012800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
xenbr0 Link encap:Ethernet HWaddr 00:17:a4:f8:79:20
inet addr:192.168.1.122 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::217:a4ff:fef8:7920/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:471842 errors:0 dropped:0 overruns:0 frame:0
TX packets:2795 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:37005780 (37.0 MB) TX bytes:182010 (182.0 KB)
那么我该如何给这个系统一个静态 IP 地址呢?抱歉,我对 Ubuntu 上的网络不太熟悉。
答案1
使用说明这里适用于 Debian。此链接包含一个配置静态 IP 地址的示例,方法是编辑 /etc/network/interfaces 以包含以下行:
iface xenbr0 inet static
bridge_ports eth0
address 192.168.1.2
broadcast 192.168.1.255
netmask 255.255.255.0
gateway 192.168.1.1