ネットワークの設定2014/08/01 |
[1] | ネットワークの設定を固定IPアドレスに変更します。 |
[root@dlp ~]#
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
[root@dlp ~]# HWADDR=00:50:43:00:3B:AE TYPE=Ethernet UUID=c1539085-73d7-4455-ac82-88f26464458a # 変更 ONBOOT= yes NM_CONTROLLED=yes # 変更 BOOTPROTO= none # 以下、追記 # サーバーに割り当てるIPアドレス IPADDR=10.0.0.30 # サブネットマスク NETMASK=255.255.255.0 # デフォルトゲートウェイ GATEWAY=10.0.0.1 # DNSサーバーのIPアドレス DNS1=10.0.0.10 IPV6INIT=no USERCTL=no /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@dlp ~]# chkconfig network on [root@dlp ~]# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:cd:9c:2d brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fecd:9c2d/64 scope link valid_lft forever preferred_lft forever |
[2] | 必要なければIPv6を無効にしておきます。 |
[root@dlp ~]# 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:cd:9c:2d brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fecd:9c2d/64 scope link valid_lft forever preferred_lft forever
[root@dlp ~]#
vi /etc/sysctl.conf # 最終行に追記 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 # 変更を反映 [root@dlp ~]# sysctl -p
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:cd:9c:2d brd ff:ff:ff:ff:ff:ff inet 10.0.0.30/24 brd 10.0.0.255 scope global eth0 valid_lft forever preferred_lft forever |
Sponsored Link |