ルータでDHCPサーバ機能を使ってプライベートIPアドレスを配布することは普通ですが、複数配布することも出来ます。
淡々とご紹介!
LANのインターフェイス毎にわける場合
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
ip lan1 address 192.168.101.251/24 ip lan2 address 192.168.102.251/24 ip lan3 address 192.168.103.251/24 dhcp service server dhcp server rfc2131 compliant except remain-silent dhcp scope 1 192.168.101.2-192.168.101.254/24 gateway 192.168.101.1 expire 4:00 maxexpire 4:00 dhcp scope 2 192.168.102.2-192.168.102.254/24 gateway 192.168.102.1 expire 4:00 maxexpire 4:00 dhcp scope 3 192.168.103.2-192.168.103.254/24 gateway 192.168.103.1 expire 4:00 maxexpire 4:00 dhcp scope option 1 dns=192.168.101.1,8.8.8.8,1.1.1.1 dhcp scope option 2 dns=192.168.102.1,8.8.8.8,1.1.1.1 dhcp scope option 3 dns=192.168.103.1,8.8.8.8,1.1.1.1 dns server 8.8.8.8 1.1.1.1 dns host lan |
VLANを利用する場合
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
ip lan1 address 192.168.100.251/24 vlan lan1/1 802.1q vid=101 name=VLAN101 ip lan1/1 address 192.168.101.1/24 vlan lan1/2 802.1q vid=102 name=VLAN102 ip lan1/2 address 192.168.102.1/24 vlan lan1/3 802.1q vid=103 name=VLAN103 ip lan1/3 address 192.168.103.1/24 dhcp service server dhcp server rfc2131 compliant except remain-silent dhcp scope 1 192.168.100.2-192.168.100.191/24 dhcp scope 101 192.168.101.2-192.168.101.191/24 dhcp scope 102 192.168.102.2-192.168.102.191/24 dhcp scope 103 192.168.103.2-192.168.103.191/24 dhcp scope option 1 dns=8.8.8.8,1.1.1.1 dhcp scope option 101 dns=8.8.8.8,1.1.1.1 dhcp scope option 102 dns=8.8.8.8,1.1.1.1 dhcp scope option 103 dns=8.8.8.8,1.1.1.1 dns server 8.8.8.8 1.1.1.1 dns host lan |
LAN1, LAN2でセグメントを分割して、LAN3をWANとしたい場合
1 2 3 4 5 6 7 8 9 10 11 12 |
ip lan1 address 192.168.1.251/24 ip lan2 address 172.16.0.1/24 dhcp service server dhcp server rfc2131 compliant except remain-silent dhcp scope 1 192.168.1.2-192.168.1.100/24 gateway 192.168.101.1 expire 4:00 maxexpire 4:00 dhcp scope 2 172.16.0.2-172.16.0.100/24 gateway 172.16.0.1 expire 4:00 maxexpire 4:00 dhcp scope option 1 dns=192.168.101.1,8.8.8.8,1.1.1.1 dhcp scope option 2 dns=172.16.0.1,8.8.8.8,1.1.1.1 dns server 8.8.8.8 1.1.1.1 dns host lan |
お疲れ様です。