dhcp をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
CentOS7でdhcpサーバを動かしている。
#code(nonumber){{
[root@c ~]# yum install dhcp
[root@c ~]#
[root@c ~]# vi /etc/dhcp/dhcpd.conf
option domain-name "sybyl.local";
option domain-name-servers 192.168.0.3, 192.168.0.1;
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.0.3, 192.168.0.1;
option domain-name "sybyl.local";
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
default-lease-time 6000;
max-lease-time 72000;
range 192.168.0.128 192.168.0.160;
}
host c101 {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.0.101;
}
[root@c ~]#
[root@c ~]# systemctl start dhcpd
}}
***DHCPで経路情報を定義できる? [#obf6b5b2]
default gatewayへの経路情報は当然定義できるが、追加で付け...
下図のようなネットワーク構成において、c101がc102へアクセ...
マシン個別に route add ... とするのもいいが、どうやら dhc...
&ref(2016y04m26d_083110750.png,nolink,noborder);
#code(nonumber){{
[root@c ~]# vi /etc/dhcp/dhcpd.conf
option domain-name "sybyl.local";
option domain-name-servers 192.168.0.3, 192.168.0.1;
option ms-classless-static-routes code 249 = array of int...
option rfc3442-classless-static-routes code 121 = array o...
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.0.3, 192.168.0.1;
option domain-name "sybyl.local";
option routers 192.168.0.1; ...
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
default-lease-time 6000;
max-lease-time 72000;
option ms-classless-static-routes 24, 192, 168, 1, 192,...
option rfc3442-classless-static-routes 24, 192, 168, 1,...
range 192.168.0.128 192.168.0.160;
}
host c101 {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.0.101;
}
[root@c ~]#
[root@c ~]# systemctl start dhcpd
}}
c101マシンにて確認してみると
#code(nonumber){{
[root@c101 ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags M...
192.168.1.0 router.sybyl.lo 255.255.255.0 UG ...
192.168.0.0 * 255.255.255.0 U ...
link-local * 255.255.0.0 U ...
default gw.sybyl.local 0.0.0.0 UG ...
[root@c101 ~]#
}}
と大丈夫みたい。
次に、windowsマシン(192.168.0.47)にて ifconfig /renew で...
&ref(2016y04m26d_101000234.png,nolink);
とこちらも正しく反映された。
***DHCPの設定だけでCentOSのネットワーク設定は完了する? [...
確かめてみた。dhcpd.confにOS未インストールマシンのMACアド...
#code(nonumber){{
[root@c ~]# vi /etc/dhcp/dhcpd.conf
(前略)
host c107 {
hardware ethernet 00:0c:29:28:76:05;
fixed-address 192.168.0.107;
option host-name "c107.sybyl.local";
}
[root@c ~]#
[root@c ~]# systemctl restart dhcpd
}}
これでCentOSをインストールしてみる。
すると、当然ながらネットワーク関係はすんなりと反映され
&ref(2016y02m11d_091937694.png,nolink);
ホスト名も「&color(red){option host-name};」にて指定され...
&ref(2016y02m11d_100001869.png,nolink);
DNSの逆引きが存在していれば、IPアドレスからホスト名が代入...
DNSの逆引きがなく、DHCPからのホスト名指定もなければ「loca...
&color(red){*};&size(10){っと言ってもDNSを正しく整備する...
***linuxでdhcp再取得は? [#y39528a7]
windowsで言うところのipアドレスの解放は
「dhclient -r」
その後にipアドレスを取得するには
「dhclinet」
を行う
終了行:
CentOS7でdhcpサーバを動かしている。
#code(nonumber){{
[root@c ~]# yum install dhcp
[root@c ~]#
[root@c ~]# vi /etc/dhcp/dhcpd.conf
option domain-name "sybyl.local";
option domain-name-servers 192.168.0.3, 192.168.0.1;
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.0.3, 192.168.0.1;
option domain-name "sybyl.local";
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
default-lease-time 6000;
max-lease-time 72000;
range 192.168.0.128 192.168.0.160;
}
host c101 {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.0.101;
}
[root@c ~]#
[root@c ~]# systemctl start dhcpd
}}
***DHCPで経路情報を定義できる? [#obf6b5b2]
default gatewayへの経路情報は当然定義できるが、追加で付け...
下図のようなネットワーク構成において、c101がc102へアクセ...
マシン個別に route add ... とするのもいいが、どうやら dhc...
&ref(2016y04m26d_083110750.png,nolink,noborder);
#code(nonumber){{
[root@c ~]# vi /etc/dhcp/dhcpd.conf
option domain-name "sybyl.local";
option domain-name-servers 192.168.0.3, 192.168.0.1;
option ms-classless-static-routes code 249 = array of int...
option rfc3442-classless-static-routes code 121 = array o...
subnet 192.168.0.0 netmask 255.255.255.0 {
option domain-name-servers 192.168.0.3, 192.168.0.1;
option domain-name "sybyl.local";
option routers 192.168.0.1; ...
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
default-lease-time 6000;
max-lease-time 72000;
option ms-classless-static-routes 24, 192, 168, 1, 192,...
option rfc3442-classless-static-routes 24, 192, 168, 1,...
range 192.168.0.128 192.168.0.160;
}
host c101 {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.0.101;
}
[root@c ~]#
[root@c ~]# systemctl start dhcpd
}}
c101マシンにて確認してみると
#code(nonumber){{
[root@c101 ~]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags M...
192.168.1.0 router.sybyl.lo 255.255.255.0 UG ...
192.168.0.0 * 255.255.255.0 U ...
link-local * 255.255.0.0 U ...
default gw.sybyl.local 0.0.0.0 UG ...
[root@c101 ~]#
}}
と大丈夫みたい。
次に、windowsマシン(192.168.0.47)にて ifconfig /renew で...
&ref(2016y04m26d_101000234.png,nolink);
とこちらも正しく反映された。
***DHCPの設定だけでCentOSのネットワーク設定は完了する? [...
確かめてみた。dhcpd.confにOS未インストールマシンのMACアド...
#code(nonumber){{
[root@c ~]# vi /etc/dhcp/dhcpd.conf
(前略)
host c107 {
hardware ethernet 00:0c:29:28:76:05;
fixed-address 192.168.0.107;
option host-name "c107.sybyl.local";
}
[root@c ~]#
[root@c ~]# systemctl restart dhcpd
}}
これでCentOSをインストールしてみる。
すると、当然ながらネットワーク関係はすんなりと反映され
&ref(2016y02m11d_091937694.png,nolink);
ホスト名も「&color(red){option host-name};」にて指定され...
&ref(2016y02m11d_100001869.png,nolink);
DNSの逆引きが存在していれば、IPアドレスからホスト名が代入...
DNSの逆引きがなく、DHCPからのホスト名指定もなければ「loca...
&color(red){*};&size(10){っと言ってもDNSを正しく整備する...
***linuxでdhcp再取得は? [#y39528a7]
windowsで言うところのipアドレスの解放は
「dhclient -r」
その後にipアドレスを取得するには
「dhclinet」
を行う
ページ名:
1