提供:すだちネットWiki
移動: 案内, 検索

ネットワーク設定(SL6)

ネットワークの設定を固定IPアドレスに変更します。

[root@host3 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="9C:8E:99:01:57:38"
NM_CONTROLLED="yes"
ONBOOT="yes" ←変更
以下、追加
BOOTPROTO=none
IPADDR=192.168.1.3 ←サーバーに割り当てるIPアドレス
NETMASK=255.255.255.0 ←サブネットマスク
TYPE=Ethernet
GATEWAY=192.168.1.1 ←デフォルトゲートウェイ
DNS1=192.168.1.1 ←DNSサーバーのIPアドレス
IPV6INIT=no
USERCTL=no

[root@host3 ~]# /etc/rc.d/init.d/network restart
Shutting down interface eth0:           [  OK  ]
Shutting down loopback interface:       [  OK  ]
Bringing up loopback interface:         [  OK  ]
Bringing up interface eth0:             [  OK  ]

[root@host3 ~]# chkconfig network on 

[root@host3 ~]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 9C:8E:99:01:57:38  
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::9e8e:99ff:fe01:5738/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:31 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2030 (1.9 KiB)  TX bytes:2672 (2.6 KiB)
          Interrupt:19 

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)

必要なければIPv6を無効にしておきます。

[root@host3 ~]# echo "install ipv6 /bin/true" > /etc/modprobe.d/disable-ipv6.conf
[root@host3 ~]# reboot

[root@host3 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 9C:8E:99:01:57:38  
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:74 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7793 (7.6 KiB)  TX bytes:7249 (7.0 KiB)
          Interrupt:19 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          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)
案内
ツールボックス
PR
個人用ツール