산대특 5기

2일차 250624

라우터 설정 ping 명령 : arp -> icmp 작동 * PC1과 PC2 연결하기 PC1에 ip 설정하기 ip 192.168.0.1 255.255.255.0 192.168.0.254 PC2에 ip 설정하기 ip 192.168.0.2 255.255.255.0 192.168.0.254 PC1에서 ping 192.168.0.2 PC2에서 ping 192.168.0.1
오늘 할 일 : 연결에 문제가 없던 것을 연결이 안되도록하기 => 1. IP를 완전 다른 것으로 주기! PC2> ip 192.168.1.2 255.255.255.0 192.168.0.254 not same subnet PC2에 ip를 192.168.0.2로 줬는데 아예 다르게 192.168.1.2로 줌 -> 0.1~0.214까지만 유효 PC1> ping 192.168.1.2 *192.168.0.254 icmp_seq=1 ttl=255 time=16.557 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=2 ttl=255 time=15.419 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=3 ttl=255 time=16.192 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=4 ttl=255 time=15.681 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=5 ttl=255 time=15.661 ms (ICMP type:3, code:1, Destination host unreachable) 연결이 안되기 때문에 Destination host unreachable 오류 메시지 전달됨 해결하려면 서브넷도 맞춰서 게이트웨이 설정해줘야함 PC2> ip 192.168.1.2 255.255.255.0 192.168.1.254 Checking for duplicate address... PC1 : 192.168.1.2 255.255.255.0 gateway 192.168.1.254 이후 PC1에서 ping 명령어 => PC1> ping 192.168.1.2 *192.168.0.254 icmp_seq=1 ttl=255 time=15.706 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=2 ttl=255 time=16.813 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=3 ttl=255 time=15.265 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=4 ttl=255 time=15.597 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=5 ttl=255 time=15.944 ms (ICMP type:3, code:1, Destination host unreachable)
2. 게이트웨이 다르게 설정하기! PC2> ip 192.168.0.129 255.255.255.128 192.168.0.254 Checking for duplicate address... PC1 : 192.168.0.129 255.255.255.128 gateway 192.168.0.254 PC1> ip 192.168.0.1 255.255.255.0 192.168.0.254 Checking for duplicate address... PC1 : 192.168.0.1 255.255.255.0 gateway 192.168.0.254 PC1> ping 192.168.0.129 192.168.0.129 icmp_seq=1 timeout 192.168.0.129 icmp_seq=2 timeout 84 bytes from 192.168.0.129 icmp_seq=3 ttl=63 time=15.622 ms 84 bytes from 192.168.0.129 icmp_seq=4 ttl=63 time=15.692 ms 84 bytes from 192.168.0.129 icmp_seq=5 ttl=63 time=16.204 ms if) ip 192.168.0.2 255.255.255.128 192.168.0.254 -> ip 192.168.0.2 255.255.255.128 192.168.0.127로 설정해야함
3. 같은 대역대로 만들고 VLAN 설정 변경하기 switch -> VLAN VLAN이 1로 연결되어있는데, 2로 변경하면 연결이 되지 않음 PC1> ping 192.168.0.2 hot (192.168.0.2) not reachable
*단 1.1.1.0/30 으로 서브넷 마스크 30으로 설정 PC1> ip 192.168.0.1 255.255.255.0 192.168.0.254 Checking for duplicate address... PC1 : 192.168.0.1 255.255.255.0 gateway 192.168.0.254 =>PC1 ip 설정 PC2> ip 192.168.1.1 255.255.255.0 192.168.1.254 Checking for duplicate address... PC1 : 192.168.1.1 255.255.255.0 gateway 192.168.1.254 =>PC2 ip 설정 & 라우터 설정 config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit PC1> ping 192.168.1.1 192.168.1.1 icmp_seq=1 timeout *192.168.0.254 icmp_seq=2 ttl=255 time=16.575 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=3 ttl=255 time=16.508 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=4 ttl=255 time=15.448 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=5 ttl=255 time=15.808 ms (ICMP type:3, code:1, Destination host unreachable) PC2> ping 192.168.0.1 192.168.0.1 icmp_seq=1 timeout *192.168.1.254 icmp_seq=2 ttl=255 time=16.530 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.1.254 icmp_seq=3 ttl=255 time=15.218 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.1.254 icmp_seq=4 ttl=255 time=15.839 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.1.254 icmp_seq=5 ttl=255 time=15.834 ms (ICMP type:3, code:1, Destination host unreachable) ping 명령을 했을 때 연결이 되지 않음 <R1 설정> config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 1.1.1.1 255.255.255.252 no shutdown <R2> config t interface Serial1/0 ip address 1.1.1.2 255.255.255.252 no shutdown 이후 R1#으로 나올 때 까지 exit R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.0.254 YES manual up up Serial1/0 1.1.1.1 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down R2#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up Serial1/0 1.1.1.2 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down 을 보면 각각 1.1.1.1과 1.1.1.2로 설정이 된 것을 볼 수 있음 다시 PC1으로 가서 ping 명령어 PC1> ping 192.168.1.1 *192.168.0.254 icmp_seq=1 ttl=255 time=14.635 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=2 ttl=255 time=15.185 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=3 ttl=255 time=16.872 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=4 ttl=255 time=16.019 ms (ICMP type:3, code:1, Destination host unreachable) *192.168.0.254 icmp_seq=5 ttl=255 time=16.545 ms (ICMP type:3, code:1, Destination host unreachable) => 아직도 연결되지 않음 R1과 R2사이, R2와 Switch 사이 wire shark 캡쳐 R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/30 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Serial1/0 C 192.168.0.0/24 is directly connected, FastEthernet0/0 => 라우팅 되는 것이 없음(연결된게 없다)
정적 라우팅 config t ip route 192.168.1.0 255.255.255.0 1.1.1.2 따라서 [R1이 연결되도록 하는 한방설정] config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 1.1.1.1 255.255.255.252 no shutdown exit ip route 192.168.1.0 255.255.255.0 1.1.1.2 [R2가 연결되도록 하는 한방설정] config t interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 1.1.1.2 255.255.255.252 no shutdown exit ip route 192.168.0.0 255.255.255.0 1.1.1.1 을 하고 다시 PC1. PC2에서 ping 명령어 설정후 다시 wire shark 확인해보면 ICMP가 뜨고 정상적으로 연결된 것임을 알 수 있다.
실제 장비로 라우터 실습해보기~ 이더넷 -> 랜선 콘솔 -> 하늘색 : 명령어 입력
케이블 카테고리 6 (Cat 6) : Ethernet(이더넷) 네트워크에 사용되는 UTP(비차폐 연선, Unshielded Twisted Pair) 케이블의 한 종류로, Category 6의 줄임말. 기존 Cat 5e보다 더 빠른 속도와 높은 대역폭을 지원한다 최대 전송 속도 1Gbps (1000Mbps) ~ 10Gbps 최대 대역폭 250 MHz 최대 거리 10Gbps: 최대 55m (EMI가 없을 경우 최대 100m) 더 두껍고 꼬임이 조밀해 전자기 간섭을 줄여준다 Cat 5e보다 더 높은 주파수와 속도 지원
다이렉트 케이블 (Straight-through Cable) : 같은 핀 번호끼리 연결 (1↔1, 2↔2, 3↔3, 6↔6 등) 일반적으로 PC ↔ 스위치, 스위치 ↔ 라우터 연결 시 사용 사용 예: PC ↔ 스위치 스위치 ↔ 라우터 허브 ↔ PC 크로스 케이블 (Crossover Cable) : 송신 ↔ 수신 핀을 교차 연결 (1↔3, 2↔6 등) 같은 종류의 장비끼리 연결 시 사용 사용 예: PC ↔ PC 스위치 ↔ 스위치 라우터 ↔ 라우터 허브 ↔ 허브
*다이렉트 케이블과 크로스 케이블 배선 1. 다이렉트 케이블 흰주.주.흰초.파.흰파.초.흰갈.갈 흰주.주.흰초.파.흰파.초.흰갈.갈 2. 크로스 케이블 흰주.주.흰초.파.흰파.초.흰갈.갈 흰초.초.흰주.파.흰파.주.흰갈.갈 =실전 해보기= 1. 시리얼을 통해 접속한다 2. enable 3. show ip interface brief 각자 다른 인터페이스를 확인 후 인터페이스 수정할 것 4. 라우터와 라우터에 연결된 케이블 (DTE,DCE) 확인 후 DCE구간에 clock rate 64000 적용할 것 5. 랜케이블을 완성 후 PC에서 라우터에 접속되는지 확인할 것 === 허브와 PC를 연결하기 때문에 다이렉트 케이블 배선으로 만든다. PC와 라우터에 연결을 하고 라우터에서 인터페이스에 맞게 네트워크 설정을 하고 PC의 cmd에서 ping -n 10000 192.168.0.254 명령어로 탐색 연결 전에는 오류 메세지가 전달되고 연결이 되면 192.168.0.254의 응답과 TTL길이 바이트, 시간등 정보가 표시된다
풀이 1. PC1에서 ip 설정하기 PC1> ip 192.168.0.1 255.255.255.0 192.168.0.254 Checking for duplicate address... PC1 : 192.168.0.1 255.255.255.0 gateway 192.168.0.254 2. PC2에서 ip 설정하기 PC2> ip 192.168.1.1 255.255.255.0 192.168.1.254 Checking for duplicate address... PC1 : 192.168.1.1 255.255.255.0 gateway 192.168.1.254 3. R1 라우터 설정하기 config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 2.2.2.1 255.255.255.248 no shutdown exit ip route 192.168.1.0 255.255.255.0 2.2.2.2 4. 설정 확인하기 R1#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.0.254 YES manual up up Serial1/0 2.2.2.1 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down 5. R2 라우터 설정하기 config t interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 2.2.2.2 255.255.255.248 no shutdown exit ip route 192.168.0.0 255.255.255.0 2.2.2.1 6. 설정 확인하기 R2#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.1.254 YES manual up up Serial1/0 2.2.2.2 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down 7. 연결 확인하기 PC1> ping 192.168.1.1 192.168.1.1 icmp_seq=1 timeout 192.168.1.1 icmp_seq=2 timeout 192.168.1.1 icmp_seq=3 timeout 192.168.1.1 icmp_seq=4 timeout 192.168.1.1 icmp_seq=5 timeout PC2> ping 192.168.0.1 192.168.0.1 icmp_seq=1 timeout 192.168.0.1 icmp_seq=2 timeout 192.168.0.1 icmp_seq=3 timeout 192.168.0.1 icmp_seq=4 timeout 192.168.0.1 icmp_seq=5 timeout => 연결이 되면 wire shark에 icmp 확인가능함
동적 라우팅! RIP(route information protocol) 최대 15개 (라우팅을 몇 번 거쳐가는지 = Hop 수) 끝까지 못찾으면 패킷 소멸 30초마다 주고받음 소규모 네트워크에서 유리 (대규모 네트워크는 불리) config t router rip version 2 -> (version 1 : 서브넷팅이 안되는 점을 보완) network 192.168.0.0 network 2.2.2.0 DNS 확인하기 : cmd에서 nslookup flowbysy.co.kr 서버: UnKnown Address: 192.168.0.99 권한 없는 응답: 이름: flowbysy.co.kr Address: 125.246.95.152 === * R1 config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 2.2.2.1 255.255.255.248 no shutdown exit router rip version 2 network 192.168.0.0 network 2.2.2.0 exit exit show ip protocols show ip route *R2 config t interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 2.2.2.2 255.255.255.248 no shutdown exit router rip version 2 network 192.168.1.0 network 2.2.2.0 exit exit show ip protocols show ip route === rip가 사용하는 ip : 224.0.0.9 === virtual box에서 WinServer2022 서버를 GNS3 프로그램으로 가져와야함 GNS에서 edit -> Preferences에서 virtual box 서버를 가져올 수 있음 PC1 = client Server
* R1(rip) config t interface FastEthernet0/0 ip address 192.168.0.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 3.3.3.1 255.255.255.128 no shutdown exit router rip version 2 network 192.168.0.0 network 2.2.2.0 exit exit show ip protocols show ip route *R2(rip) config t interface FastEthernet0/0 ip address 192.168.1.254 255.255.255.0 no shutdown exit interface Serial1/0 ip address 3.3.3..2 255.255.255.128 no shutdown exit router rip version 2 network 192.168.1.0 network 2.2.2.0 exit exit show ip protocols show ip route