Monday, January 6, 2014

Ubuntu Server 12.04: Static IP

Ubuntu Server 12.04: Static IP
--------------------------------------------------------------------------------
まずは、vimで/etc/network/interfacesを編集します。
$ sudo vim /etc/network/interfaces

下記のような感じで編集
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
 address 192.168.0.******* ←固定ip
 netmask 255.255.255.****  ←ネットマスク
 gateway 192.168.0.***  ←デフォルトゲートウェイ(ルータのipでおk)


最後に
$ sudo /etc/init.d/networking restart

ipconfigでちゃんとなってたらOK
$ sudo  vim /etc/resolv.conf
で下記の1行を追加する。

nameserver 192.168.xx.1

保存して終了

Ubuntu Server 12.04: SSH Server is default install with default port:

No comments:

Post a Comment