然后使用以下命令更新网络设置和重新启动网络服务:
ben@linux-cotk:~> sudo /sbin/netconfig update -f ben@linux-cotk:~> sudo /etc/init.d/network restart Shutting down network interfaces: eth0 device: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40) eth0 done Shutting down service network . . . . . . . . . done Hint: you may set mandatory devices in /etc/sysconfig/network/config Setting up network interfaces: eth0 device: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 40) eth0 IP address: 10.2.31.15/24 eth0 done Setting up service network . . . . . . . . . . done SUSEfirewall2: Setting up rules from /etc/sysconfig/SuSEfirewall2 ... SuSEfirewall2: Warning: no default firewall zone defined, assuming 'ext' SuSEfirewall2: batch committing... SuSEfirewall2: Firewall rules successfully set ben@linux-cotk:~> /sbin/ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:75:DD:F6 inet addr:10.2.31.15 Bcast:10.2.31.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fe75:ddf6/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1103 errors:0 dropped:0 overruns:0 frame:0 TX packets:187 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:141042 (137.7 Kb) TX bytes:59526 (58.1 Kb) Interrupt:10 Base address:0xd020 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:14 errors:0 dropped:0 overruns:0 frame:0 TX packets:14 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:820 (820.0 b) TX bytes:820 (820.0 b)然后使用以下命令在 /etc/hosts 文件中增加 ben.skyiv.com 的域名。注意这里 IP 地址必须是 127.0.0.1。
ben@linux-cotk:~> sudo vim /etc/hosts在宿主机的 Ubuntu 10.10 操作系统的 /etc/hosts 文件中也增加一个 ben.skyiv.com 域名,指向 10.2.31.15,即运行 openSUSE 11.3 操作系统的客户机的静态网络地址。
ben@ben-m4000t:~$ vim /etc/hosts