라우터와 연결된 스위치에 ip주소를 넣어준다.

 

Router(config)# int fa0/0

Router(config-if)# ip address 172.16.0.1 255.255.255.0

Router(config-if)# no shutdown

 

Router(config)# int fa0/1

Router(config-if)# ip address 172.16.1.1 255.255.255.0

Router(config-if)# no shutdown

 

DHCP 설정을 해준다.

 

ip dhcp pool LEFT
 network 172.16.0.0 255.255.255.0
 default-router 172.16.0.1
 dns-server 172.16.0.1

ip dhcp pool RIGHT
 network 172.16.1.0 255.255.255.0
 default-router 172.16.1.1
 dns-server 172.16.1.1

 

위와 같은 명령어를 통해 DHCP의 IP주소, Subnetmask, Gateway 주소, DNS 서버 주소를 입력해 줄 수 있다.

 

 

 

PC 설정으로 들어가 DHCP를 선택하면, 위에서 설정한 DHCP에 맞춰 자동으로 IP주소, Subnetmask, Gateway 주소, DNS 서버 주소가 입력된다.

 

 

4개의 PC에 자동으로 기입된 정보를 토대로 핑을 쏘자, 서로 통신이 되는 것을 알 수 있었다.

+ Recent posts