• 기본 개체 (핵심 개체) - 학생, 부서, 사원 등과 같이 기본 정보를 포함한 개체 - 정보 처리를 위해 기본적(독립적)으로 존재하는 개체
• 개념 개체 - 업무처리나 흐름을 위해 무형의 과정이나 개념을 위해 만들어진 개체 - 공정, 상태와 같이 핵심개체의 일부로 여겨지기도 한다.
• 교차 개체(관련 개체) - 두 개체간에 관계를 위해 만들어지는 개체 - N:M 관계를 해소하는 역할을 한다. - 예 : 구매, 입고, 학생과 교수 관계(성적: 학생-교수의 교차개체)
▷ 개체 구분
• 상위개체(Super type entity) : 하위 개체(Sub type entity) - 부모 개체 : 자식 개체 (ex. 학생, 교수 table) - 독립 개체 : 종속 개체 (ex. 과목 - 교수의 자식 table)
▷ 개체 정의 - 선입견을 버리는 것이 중요 - 명확한 의미를 정의 - 서류, 인터뷰 등을 기본 자료로 이용 - Top-down 방법으로 접근 (권한)
▷ 개체 정의 요소 - 개체 명칭 - 개체 설명과 의미 - 약어및 동의어 - 차후 데이터 출현 량에 대한 예측
▷ 개체 검토 항목 - 명칭 : 적절한 구별 가능한 이름이 사용되었는가? - 상호배타성 : 각 row는 구별 가능한가? - 정규화 준수 - 주 식별자(식별자) : 적절한 종속관계가 유지되는가? - 속성의 구성 : 최소 둘 이상의 연관 있는 속성로 구성되었는가? - 동의어 : 동의어 파악은 적절한가? - 크기 및 사용 : 개체의 크기와 사용 빈도수(메모리 상주여부) - 관계 : 최소 한 개 이상의 관계가 있는가? (불필요한 관계 설정이 없는지?)
▷ 단일 사례 개체
▷ 개체 고립
▷ 동의로 인한 중복 개체
관계
: 두 개 이상의 개체간에 명명 되어진 의미 있는 연결
▷ 관계 차수
필수 : | 선택 : ○ 다중 : <
▷ 관계 표현
▷ 관계의 종류 • 종속관계 : 개체간에 주/종 관계를 표현 - 식별관계 : 외부 식별자가 주 식별자인 경우 - 비식별관계 : 외부 식별자가 일반 속성인 경우 • 중복관계 : 개체간 두 번의 종속관계 • 재귀관계 : 자기 자신을 참조 • 배타관계 - 배타적 논리합(Exclusive, xor) : 중복이 없음 - 배타적 논리곱(inclusive) : 중복 가능
식별자
• 주 식별자 (primary identifier) - 개체내의 tuple을 유일하게 구별할 수 있어야 한다. (주식별자는 나머지 속성에 대해서 결정인자이다. / 나머지 속성은 주식별자 컬럼에 대해 함수적 종속 관계이다.) - 한 개의 속성, 속성의 조합으로 구성된다. • 부 식별자 후보 식별자중 주 식별자로 지정되지 않은 식별자 Index 구성이 선택되어 질 수 있다. ※ 일반 속성은 주 식별자에 반드시 함수적 종속관계가 유지 되어야 한다.
• 클라이언트가 크롬을 이용해 Application layer에서 받은 메시지를 transport layer에서 서버의 아파치로 전송
• transport layer는 application (프로세스)간에 논리적인 연결을 담당
• 서로 다른 host간에 작동하는 app process간에 논리적인 통신(logical communication)을제공
• transport protocol은 end system에서 작동
- 송신측 : app message를 segment로 변환 network layer에 전달한다. - 수신측 : network layer로 부터 전달받은 segment로 부터 message를 추출 app layer에 전달한다.
• 네트워크 app는 하나이상의 transport protocol을 사용 할 수 있다. - 인터넷 : TCP, UDP
TCP : 신뢰성, 패킷 손상X
UDP : 속도 빠름, 패킷이 손상을 입을 수 있음. (ex. DNS)
*TCP는 패킷을 보내고 난 뒤에도 패킷이 안깨지고 도착할 때까지 application layer에서 준 패킷을 가지고 있는다.
(버퍼에 저장)
◾ Transport vs Network layer
• network layer : host(end system) 간에 logical communication을 제공 > protocol : IP • transport layer : process간에 logical communication을 제공 > protocol : TCP, UDP - Network layer가 제공하지 못하는 신뢰적인 전송을 제공 할 수 있다. - 그러나 network layer의 제약을 받는 경우도 있다.
- 지연이나 대역폭에 대한 보장은 불가능하다.
◾ TCP, UDP
• 신뢰적인 연결지향 서비스(TCP) - 혼잡제어 (송신자) - 흐름제어 (수신자) : 패킷을 전송할 수 있는 최대 양을 지정 - 연결지향 : 송신자가 수신자에게 초기화하는 패킷을 송신, 송신자가 송신하는 것을 수신자에게 알려주고 데이터 송신
• 비신뢰적인 비연결지향 서비스(UDP) - best-effort delivery service : IP : data 전달에 최선을 다하지만 어떠한 보장도 하지 않는다.
• 보장하지 않는것 (패킷망 사용) - 최대 지연시간 - 전달 대역폭
Multiplexing/demultiplexing
• multiplexing (다중화) : 프로세스가 tcp에게 메시지를 보내기 위해서 socket를 연다.
• demultiplexing (역다중화) : tcp가 소켓을 통해 application에게 메시지를 추출해 보낸다. -> 어플리케이션에게 메시지 보냄
프로세스 P1과 P2를 구별하기 위해 포트넘버가 필요하다. (IP가 같을 수 있기 때문)
*서버 프로세스는 포트넘버는 다 같음
◾ Transport layer에서 demultiplexing 요구 사항
• 각 socket은 유일한 식별자를 갖는다. • 각 segement는 segment가 전달될 적절한 socket을 가르키는 특별한 field를 갖는다. • 이들 특별한 field는 source와 destination의 port 번호이다.
(0~1023 까지의 port를 well-know port라고 한다 : RFC 1700에 명시되어있다.)
Segment가 host에 도착하면 T/L는 segment안에 목적지의 port #를 검사하고 이에 상응하는 socket으로 data를 전달한다.
◾ UDP
Port #를 이용 socket을 생성한다. DatagramSocket mysocket1=new DatagramSocket(59111); DatagramSocket mysocket1=new DatagramSocket(59222);
*UDP socket은 목적지 IP와 목적지 port #로 구성된 두 요소로 된집합에 의해 식별된다.
◾ UDP segment 전달 • Segment의 dest port #를 검사한다. • Segment를 적절한 socket으로전달한다. • 두개의 UDP segment들이 출발지 IP나 port # 가 둘다 다르거나 둘중 하나가 다르더라도 동일한 목적지 IP와 port #를 갖는다면 동일한 socket을 통해 process에 전달된다.
◾ Connectionless demultiplexing 의 특징
DatagramSocket serverSocket = new DatagramSocket(6428);
프로세서가 하나밖에 안뜬다.
◾ TCP
• TCP socket는 4개의 요소로 구성된 집합에 의해 식별된다.
- source IP - source port # - dest IP - dest port #
*소켓은 자신의 포트넘버, 목적지 포트 넘버, 목적지 IP와 송신 IP를 모두 알아야한다. 통신할때 구별해준다.
멀티 스레드 서버
프로세스 하나가 소켓을 여러개 사용해 보낸다.
멀티 스레드로 사용하면 메모리를 줄일 수 있다.
UDP (User Datagram Protocol) [RFC 768]
◾ UDP는 Transport layer에서 할 수 있는 최소한의 기능으로 동작한다. • App가 거의 IP와 직접 통신하는 것이다. • mulx/demulx 기능만을 제공
◾ “best effort” (보장하지 않는다.) • 손실가능 • 전송순서가 바뀔 가능
◾ connectionless • UDP sender와 receiver간에 handshaking하지 않는다. • 각 UDP segment들은 서로 독립적으로 전달된다.
◾ UDP를 이용하는 이유 • 연결설정이 없다. 예비동작 없이 전송함으로 설정에따른 어떠한 지연도 없다.(DNS) • 연결상태가 없다.
연결상태 유지를 위한 변수가 없음으로 TCP보다 많은 app를 수용할수 있다. • header가 작다. 8 byte (TCP : 20 byte) • 혼잡제어하지 않는다. (혼잡제어 : 송진자가 네트워크가 혼잡하면 송신량을 줄인다.)
네트워크의 혼잡도를 고려하지 않음으로 app가 요구하는 전송을 전송량을 제한없이 전송한다.(SNMP)
◾ often used for streaming multimedia apps • 손실 허용 • Rate sensitive
◾ UDP를 사용하는 app • DNS • SNMP
◾ app가 신뢰성을 제공한다면 UDP상에서도 신뢰성있는 통신이 가능하다. • app이 신뢰성있는 통신을 위해 확인응답이나 재전송등의 기능을 제공해야한다.
UDP checksum
: 전송된 segment에 “errors”를 검출
16bits = 2byte
◾ Sender
• Segment의 content는 순서에 따라 16bit integers로 간주한다. • 모든 16bit(word)의 합을 가지고 1의 보수를 수행한다. (이때 오버플로우는 버린다.) • 결과는 UDP segment checksum field에 삽입한다. • overflow bit를 wraparound로 이용 하는 경우도 있음
◾ receiver
• Segment를 수신후 checksum을 포함한 모든 16bit word를 더한다. • 값이 모두 1이면 에러가 없지만 하나라도 0이 나오면 오류가 있다. • 참고 (checksum을 사용하는 방법과 bit sum에서 발생하는 overflow를 처리하는 방법이 다름. 과정은 다르지만 판단 결과는 동일)
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 192.168.12.1 0.0.0.0 area 0
R1(config-router)#network 192.168.31.1 0.0.0.0 area 0
R2
R2(config-router)#network 2.2.2.1 0.0.0.0 area 0
R2(config-router)#network 192.168.12.2 0.0.0.0 area 0
R2(config-router)#network 192.168.23.2 0.0.0.0 area 0
R3
R3(config-router)#network 3.3.3.1 0.0.0.0 area 0
R3(config-router)#network 192.168.31.3 0.0.0.0 area 0
R3(config-router)#network 192.168.23.3 0.0.0.0 area 0
OSPF 설정 확인
R1
R1#show ip protocol
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 1.1.1.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
1.1.1.1 0.0.0.0 area 0
192.168.12.1 0.0.0.0 area 0
192.168.31.1 0.0.0.0 area 0
Routing Information Sources:
Gateway Distance Last Update
1.1.1.1 110 00:01:32
2.2.2.1 110 00:01:32
3.3.3.1 110 00:01:32
Distance: (default is 110)
R2
R2#show ip protocol
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 2.2.2.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
2.2.2.1 0.0.0.0 area 0
192.168.12.2 0.0.0.0 area 0
192.168.23.2 0.0.0.0 area 0
Routing Information Sources:
Gateway Distance Last Update
1.1.1.1 110 00:10:45
2.2.2.1 110 00:10:46
3.3.3.1 110 00:10:45
Distance: (default is 110)
R3
R3#show ip protocol
Routing Protocol is "ospf 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 3.3.3.1
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
3.3.3.1 0.0.0.0 area 0
192.168.31.3 0.0.0.0 area 0
192.168.23.3 0.0.0.0 area 0
Routing Information Sources:
Gateway Distance Last Update
1.1.1.1 110 00:12:33
2.2.2.1 110 00:12:33
3.3.3.1 110 00:12:33
Distance: (default is 110)
neighbor 컴퓨터 확인
R1
R1#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.1 0 FULL/ - 00:00:38 192.168.12.2 Serial0/0/0
3.3.3.1 0 FULL/ - 00:00:34 192.168.31.3 Serial0/0/1
R1#show ip ospf int s0/0/0
Serial0/0/0 is up, line protocol is up
Internet address is 192.168.12.1/24, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT-TO-POINT, Cost: 64
Transmit Delay is 1 sec, State POINT-TO-POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1 , Adjacent neighbor count is 1
Adjacent with neighbor 2.2.2.1
Suppress hello for 0 neighbor(s)
R2
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.1 0 FULL/ - 00:00:33 192.168.23.3 Serial0/0/0
1.1.1.1 0 FULL/ - 00:00:32 192.168.12.1 Serial0/0/1
R2#show ip ospf int s0/0/0
Serial0/0/0 is up, line protocol is up
Internet address is 192.168.23.2/24, Area 0
Process ID 1, Router ID 2.2.2.1, Network Type POINT-TO-POINT, Cost: 64
Transmit Delay is 1 sec, State POINT-TO-POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:02
Index 3/3, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1 , Adjacent neighbor count is 1
Adjacent with neighbor 3.3.3.1
Suppress hello for 0 neighbor(s)
R3
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.1 0 FULL/ - 00:00:30 192.168.23.2 Serial0/0/1
1.1.1.1 0 FULL/ - 00:00:30 192.168.31.1 Serial0/0/0
R3#show ip ospf int s0/0/0
Serial0/0/0 is up, line protocol is up
Internet address is 192.168.31.3/24, Area 0
Process ID 1, Router ID 3.3.3.1, Network Type POINT-TO-POINT, Cost: 64
Transmit Delay is 1 sec, State POINT-TO-POINT,
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:08
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 1 , Adjacent neighbor count is 1
Adjacent with neighbor 1.1.1.1
Suppress hello for 0 neighbor(s)
OSPF에 의해 라우팅 정보 받아왔는지 확인
R1
R1#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, GigabitEthernet0/0
L 1.1.1.1/32 is directly connected, GigabitEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0/24 [110/65] via 192.168.12.2, 00:03:05, Serial0/0/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0/24 [110/65] via 192.168.31.3, 00:02:25, Serial0/0/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial0/0/0
L 192.168.12.1/32 is directly connected, Serial0/0/0
O 192.168.23.0/24 [110/128] via 192.168.12.2, 00:02:25, Serial0/0/0
[110/128] via 192.168.31.3, 00:02:25, Serial0/0/1
192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.31.0/24 is directly connected, Serial0/0/1
L 192.168.31.1/32 is directly connected, Serial0/0/1
R2
R2#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/24 is subnetted, 1 subnets
O 1.1.1.0/24 [110/65] via 192.168.12.1, 00:11:16, Serial0/0/1
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, GigabitEthernet0/0
L 2.2.2.1/32 is directly connected, GigabitEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0/24 [110/65] via 192.168.23.3, 00:10:56, Serial0/0/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial0/0/1
L 192.168.12.2/32 is directly connected, Serial0/0/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial0/0/0
L 192.168.23.2/32 is directly connected, Serial0/0/0
O 192.168.31.0/24 [110/128] via 192.168.12.1, 00:10:56, Serial0/0/1
[110/128] via 192.168.23.3, 00:10:56, Serial0/0/0
R3
R3#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/24 is subnetted, 1 subnets
O 1.1.1.0/24 [110/65] via 192.168.31.1, 00:12:42, Serial0/0/0
2.0.0.0/24 is subnetted, 1 subnets
O 2.2.2.0/24 [110/65] via 192.168.23.2, 00:12:42, Serial0/0/1
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 3.3.3.0/24 is directly connected, GigabitEthernet0/0
L 3.3.3.1/32 is directly connected, GigabitEthernet0/0
O 192.168.12.0/24 [110/128] via 192.168.31.1, 00:12:42, Serial0/0/0
[110/128] via 192.168.23.2, 00:12:42, Serial0/0/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, Serial0/0/1
L 192.168.23.3/32 is directly connected, Serial0/0/1
192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.31.0/24 is directly connected, Serial0/0/0
L 192.168.31.3/32 is directly connected, Serial0/0/0
PC에서 TEST
PC1
C:\>ping 2.2.2.11
Pinging 2.2.2.11 with 32 bytes of data:
Request timed out.
Reply from 2.2.2.11: bytes=32 time=5ms TTL=126
Reply from 2.2.2.11: bytes=32 time=3ms TTL=126
Reply from 2.2.2.11: bytes=32 time=7ms TTL=126
Ping statistics for 2.2.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 7ms, Average = 5ms
C:\>ping 3.3.3.11
Pinging 3.3.3.11 with 32 bytes of data:
Request timed out.
Reply from 3.3.3.11: bytes=32 time=5ms TTL=126
Reply from 3.3.3.11: bytes=32 time=6ms TTL=126
Reply from 3.3.3.11: bytes=32 time=6ms TTL=126
Ping statistics for 3.3.3.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 6ms, Average = 5ms
PC2
C:\>ping 1.1.1.11
Pinging 1.1.1.11 with 32 bytes of data:
Reply from 1.1.1.11: bytes=32 time=2ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126
Ping statistics for 1.1.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 6ms, Average = 4ms
C:\>ping 3.3.3.11
Pinging 3.3.3.11 with 32 bytes of data:
Reply from 3.3.3.11: bytes=32 time=6ms TTL=126
Reply from 3.3.3.11: bytes=32 time=5ms TTL=126
Reply from 3.3.3.11: bytes=32 time=5ms TTL=126
Reply from 3.3.3.11: bytes=32 time=6ms TTL=126
Ping statistics for 3.3.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 6ms, Average = 5ms
PC3
C:\>ping 1.1.1.11
Pinging 1.1.1.11 with 32 bytes of data:
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=2ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=7ms TTL=126
Ping statistics for 1.1.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 7ms, Average = 5ms
C:\>ping 2.2.2.11
Pinging 2.2.2.11 with 32 bytes of data:
Reply from 2.2.2.11: bytes=32 time=6ms TTL=126
Reply from 2.2.2.11: bytes=32 time=6ms TTL=126
Reply from 2.2.2.11: bytes=32 time=6ms TTL=126
Reply from 2.2.2.11: bytes=32 time=7ms TTL=126
Ping statistics for 2.2.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 7ms, Average = 6ms
아래와 같이 라우터 연결을 하나 끊어도 통신이 잘 되는 것을 확인할 수 있다.
PC2
C:\>ping 1.1.1.11
Pinging 1.1.1.11 with 32 bytes of data:
Reply from 1.1.1.11: bytes=32 time=7ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Reply from 1.1.1.11: bytes=32 time=5ms TTL=126
Reply from 1.1.1.11: bytes=32 time=6ms TTL=126
Ping statistics for 1.1.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 7ms, Average = 6ms
C:\>ping 3.3.3.11
Pinging 3.3.3.11 with 32 bytes of data:
Reply from 3.3.3.11: bytes=32 time=10ms TTL=125
Reply from 3.3.3.11: bytes=32 time=8ms TTL=125
Reply from 3.3.3.11: bytes=32 time=8ms TTL=125
Reply from 3.3.3.11: bytes=32 time=7ms TTL=125
Ping statistics for 3.3.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 7ms, Maximum = 10ms, Average = 8ms
R2의 라우팅 정보는 변경되지 않는다.
R2#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/24 is subnetted, 1 subnets
O 1.1.1.0/24 [110/65] via 192.168.12.1, 00:20:03, Serial0/0/1
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, GigabitEthernet0/0
L 2.2.2.1/32 is directly connected, GigabitEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
O 3.3.3.0/24 [110/129] via 192.168.12.1, 00:03:18, Serial0/0/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, Serial0/0/1
L 192.168.12.2/32 is directly connected, Serial0/0/1
O 192.168.31.0/24 [110/128] via 192.168.12.1, 00:03:18, Serial0/0/1
OSPF DR, BDR 실습
OSPF 인터페이스 설정
R1
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
R1(config-router)#network 5.5.5.1 0.0.0.0 area 0
R2
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.1
R2(config-router)#network 2.2.2.1 0.0.0.0 area 0
R2(config-router)#network 5.5.5.2 0.0.0.0 area 0
R3
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.1
R3(config-router)#network 3.3.3.1 0.0.0.0 area 0
R3(config-router)#network 5.5.5.3 0.0.0.0 area 0
R4
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.1
R4(config-router)#network 4.4.4.1 0.0.0.0 area 0
R4(config-router)#network 5.5.5.4 0.0.0.0 area 0
DR, BDR 확인
라우터를 킨 순서로 DR, BDR이 선정된다.
DR, BDR이 선정되면 다시 선정하는 작업은 하지 않는다.
R4#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DR 00:00:39 5.5.5.1 GigabitEthernet0/1
3.3.3.1 1 2WAY/DROTHER 00:00:30 5.5.5.3 GigabitEthernet0/1
2.2.2.1 1 FULL/BDR 00:00:33 5.5.5.2 GigabitEthernet0/1
DR로 선정된 R1을 끄면 DR이 변경되는 것을 확인할 수 있다.
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.1 1 FULL/DR 00:00:37 5.5.5.2 GigabitEthernet0/1
4.4.4.1 1 FULL/BDR 00:00:37 5.5.5.4 GigabitEthernet0/1
1.1.1.1 1 2WAY/DROTHER 00:00:37 5.5.5.1 GigabitEthernet0/1
PC TEST
PC1
C:\>ping 3.3.3.11
Pinging 3.3.3.11 with 32 bytes of data:
Request timed out.
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126
Reply from 3.3.3.11: bytes=32 time<1ms TTL=126
Ping statistics for 3.3.3.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Multi area OSPF
Router 설정
R0_1
R0_1(config)#router ospf 1
R0_1(config-router)#router-id 192.168.0.1
R0_1(config-router)#network 192.168.0.1 0.0.0.0 area 0
R0_1(config-router)#network 192.168.1.1 0.0.0.0 area 1
R0_2
R0_2(config)#router ospf 1
R0_2(config-router)#router-id 192.168.0.2
R0_2(config-router)#network 192.168.0.2 0.0.0.0 area 0
R0_2(config-router)#network 192.168.2.1 0.0.0.0 area 2
R1
R1(config)#router ospf 1
R1(config-router)#router-id 192.168.10.1
R1(config-router)#network 192.168.10.1 0.0.0.0 area 1
R1(config-router)#network 192.168.1.2 0.0.0.0 area 1
R2
R2(config)#router ospf 1
R2(config-router)#router-id 192.168.20.1
R2(config-router)#network 192.168.20.1 0.0.0.0 area 2
R2(config-router)#network 192.168.2.2 0.0.0.0 area 2
PC1에서 TEST
C:\>ping 192.168.20.3
Pinging 192.168.20.3 with 32 bytes of data:
Request timed out.
Reply from 192.168.20.3: bytes=32 time=59ms TTL=124
Reply from 192.168.20.3: bytes=32 time=11ms TTL=124
Reply from 192.168.20.3: bytes=32 time=10ms TTL=124
Ping statistics for 192.168.20.3:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 10ms, Maximum = 59ms, Average = 26ms
: 계층화 된 라우팅 프로토콜이다. • IGP(Internal Gateway Protocol) - AS(Autonomous System)내부에 사용 • Area에 의해 효율적인 라우팅 정보 관리가 가능하다. - Backbone area(Area0)을 통해 연결된다. - Area0에 연결되지 못하면 Virtual link를 통해 연결한다. - Area 내에서 LSA를 교환한다. • Link의 cost를 기반으로 경로를 배정한다. - Hop 제한이 없다. (라우터 개수 제한X) - Dijkstra의 SPF알고리즘을 바탕으로 경로가 선택된다. - link cost = 기준대역폭/실제대역폭 • VLSM을 지원한다.
OSPF - area
• ABR : Area Border Router (Area 사이에 있는 라우터 정보를 주고 받음) • IR : Internal Router (Area 망 안에 있는 라우터) • ASBR : Autonomous System Boundary Router (AS 망 내부와 AS망 외부를 연결) (RIP에서는 Default Gateway 역할)
OSPF - 구조
◾ 라우터의 구분 • IR : Area 내부 라우터 • ABR : Area를 연결하는 라우터 • ASBR : AS와 연결하는 외부 연결 라우터 • DR(Designated Router) : Link stat 정보를 취합, 관리하는 라우터 : IR과 DR간에 link stat 정보를 주고 받는다.
◾ OSPF는 neighbor 간에 라우팅 정보를 공유한다. • 라우터 간에 이런 adjacency를 위한 조건이 필요하다. • 동일 area에 위치한다. • 동일한 인증 정보 • 동일한 Hello interval 및 Dead interval을 가져야한다. - 이들 값은 토플로지에 따라 자동으로 결정된다. - 10초, 40초 : ppp, ethernet
◾ OSPF의 네이버(Neighbor)와 인접 관계(Adjacency)는 동일한 의미가 아니다. • 네이버 라우터 중에 인접관계인 라우터와 LSA를 교환한다. • 이를 통해 모든 라우터가 동일한 링크 정보를 유지한다. • Adjancency 는 DR(BDR)과 IR간에 이뤄진다.
• DR, BDR은 인접관계
• 일반 라우터간에는 인접관계X
• 네이버 : 같은 area 안에 있는 컴퓨터
• 인접관계 : 라우팅 정보를 주고받는 것
◾ 라우팅을 위한 패킷 유형 • Hello 패킷 - Neighbor를 맺기 위해 전송하는 정보 • DBD(Database Description) - 저장된 네트워크 정보에 대한 요약 정보 • LSR(Link State Request) - DBD를 받았을 때 가지지 못한 정보를 요청 • LSU(Link State Update) - LSR에 대한 응답 - 네트워크에 대한 자세한 링크 정보 • LSAck(Link State Ack)
◾ OSPF LSA 송수신 • Neighbor 간에 네트워크 정보는 공유된다. • 동기화가 마무리 되면 변경된 정보만 전달된다. • 30분마다 정보를 확인한다. • Area 내에 라우터 간에 링크 정보는 LSA(Link State Advertisement)로 전달한다.
OSPF 설정
1) OSPF 라우팅 프로세스 활성화 2) Router ID • Router ID는 OSPF를 사용하는 Router를 식별하기 위한 식별정보이다. • 인터페이스 IP중 가장 높은 IP가 ID로 사용된다. • Router ID가 인터페이스의 상태에 따라 달라지는 것을 방지한다. - router-id 명령으로 id를 지정한다. - local loopback 인터페이스에 IP를 할당한다. • 반드시 필요한 과정은 아니다. 3) 각 인터페이스의 네트워크 등록 4) OSPF 작동 확인
◾ OSPF 프로세스 활성화 • 프로세스 ID에 대한 제약은 거의 없다. • 관리자의 정책에 따라 결정한다. • 명령 router ospf [process‐id] ex) router ospf 1
◾ OSPF 확인 명령 • show ip ospf neighbor - OSPF 네이버를 확인한다. • show ip ospf - OSPF 프로세서에 대한 정보를 확인한다. • show ip ospf interface - OSPF에 참여하는 인터페이스의 자세한 상태정보를 확인한다. • show ip ospf database - OSPF 링크 상태 데이터베이스를 열람한다. - LSA의 요약정보를 보여주지만 실제 링크 상태는 알 수 없다. • show ip ospf database [추가] - router, network, summary ......
R1(config)#int s0/0/0
R1(config-if)#ip address 3.3.3.1 255.255.255.252
R1(config-if)#no shutdown
R1#show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.1.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 3.3.3.1 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
R2
R2(config)#int s0/0/0
R2(config-if)#ip address 3.3.3.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#int s0/0/1
R2(config-if)#ip address 3.3.3.5 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset administratively down down
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 3.3.3.2 YES manual up up
Serial0/0/1 3.3.3.5 YES manual up up
Vlan1 unassigned YES unset administratively down down
R3
R3(config)#int s0/0/0
R3(config-if)#ip address 3.3.3.6 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 2.2.2.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 3.3.3.6 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
라우팅 설정 전 PC1 > PC2 테스트
핑이 되지 않는다.
C:\>ping 2.2.2.11
Pinging 2.2.2.11 with 32 bytes of data:
Reply from 1.1.1.1: Destination host unreachable.
Reply from 1.1.1.1: Destination host unreachable.
Reply from 1.1.1.1: Destination host unreachable.
Reply from 1.1.1.1: Destination host unreachable.
Ping statistics for 2.2.2.11:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
R1#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, GigabitEthernet0/0
L 1.1.1.1/32 is directly connected, GigabitEthernet0/0
R 2.0.0.0/8 [120/2] via 3.3.3.2, 00:00:12, Serial0/0/0
3.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 3.3.3.0/30 is directly connected, Serial0/0/0
L 3.3.3.1/32 is directly connected, Serial0/0/0
R 3.3.3.4/30 [120/1] via 3.3.3.2, 00:00:12, Serial0/0/0
R2
R2#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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
R 1.0.0.0/8 [120/1] via 3.3.3.1, 00:00:20, Serial0/0/0
R 2.0.0.0/8 [120/1] via 3.3.3.6, 00:00:23, Serial0/0/1
3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 3.3.3.0/30 is directly connected, Serial0/0/0
L 3.3.3.2/32 is directly connected, Serial0/0/0
C 3.3.3.4/30 is directly connected, Serial0/0/1
L 3.3.3.5/32 is directly connected, Serial0/0/1
R3
R3#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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
R 1.0.0.0/8 [120/2] via 3.3.3.5, 00:00:05, Serial0/0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, GigabitEthernet0/0
L 2.2.2.1/32 is directly connected, GigabitEthernet0/0
3.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R 3.3.3.0/30 [120/1] via 3.3.3.5, 00:00:05, Serial0/0/0
C 3.3.3.4/30 is directly connected, Serial0/0/0
L 3.3.3.6/32 is directly connected, Serial0/0/0
PC1 테스트
C:\>ping 2.2.2.11
Pinging 2.2.2.11 with 32 bytes of data:
Request timed out.
Reply from 2.2.2.11: bytes=32 time=7ms TTL=125
Reply from 2.2.2.11: bytes=32 time=9ms TTL=125
Reply from 2.2.2.11: bytes=32 time=9ms TTL=125
Ping statistics for 2.2.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 7ms, Maximum = 9ms, Average = 8ms
C:\>ping 3.3.3.5
Pinging 3.3.3.5 with 32 bytes of data:
Reply from 3.3.3.5: bytes=32 time=6ms TTL=254
Reply from 3.3.3.5: bytes=32 time=6ms TTL=254
Reply from 3.3.3.5: bytes=32 time=6ms TTL=254
Reply from 3.3.3.5: bytes=32 time=4ms TTL=254
Ping statistics for 3.3.3.5:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 6ms, Average = 5ms
PC2 테스트
C:\>ping 1.1.1.11
Pinging 1.1.1.11 with 32 bytes of data:
Reply from 1.1.1.11: bytes=32 time=10ms TTL=125
Reply from 1.1.1.11: bytes=32 time=8ms TTL=125
Reply from 1.1.1.11: bytes=32 time=8ms TTL=125
Reply from 1.1.1.11: bytes=32 time=9ms TTL=125
Ping statistics for 1.1.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 8ms, Maximum = 10ms, Average = 8ms
C:\>ping 3.3.3.1
Pinging 3.3.3.1 with 32 bytes of data:
Reply from 3.3.3.1: bytes=32 time=8ms TTL=253
Reply from 3.3.3.1: bytes=32 time=7ms TTL=253
Reply from 3.3.3.1: bytes=32 time=6ms TTL=253
Reply from 3.3.3.1: bytes=32 time=8ms TTL=253
Ping statistics for 3.3.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 8ms, Average = 7ms
2. default route 설정을 이용
1번 파일에서 설정한다.
loopback 인터페이스를 활성화
R2(config)#int loopback0
R2(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R2(config-if)#ip add 10.10.10.1 255.255.255.0
R2(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset administratively down down
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 3.3.3.2 YES manual up up
Serial0/0/1 3.3.3.5 YES manual up up
Loopback0 10.10.10.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
default route 인터페이스를 지정하고 이를 rip이 광고하도록 설정
R2(config-if)#ip route 0.0.0.0 0.0.0.0 loopback0
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)#router rip
R2(config-router)#default-information originate
R2(config-router)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
R 1.0.0.0/8 [120/1] via 3.3.3.1, 00:00:18, Serial0/0/0
R 2.0.0.0/8 [120/1] via 3.3.3.6, 00:00:20, Serial0/0/1
3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 3.3.3.0/30 is directly connected, Serial0/0/0
L 3.3.3.2/32 is directly connected, Serial0/0/0
C 3.3.3.4/30 is directly connected, Serial0/0/1
L 3.3.3.5/32 is directly connected, Serial0/0/1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Loopback0
L 10.10.10.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Loopback0
default route 정보가 갱신되었는지 확인
R1
R1#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 3.3.3.2 to network 0.0.0.0
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, GigabitEthernet0/0
L 1.1.1.1/32 is directly connected, GigabitEthernet0/0
R 2.0.0.0/8 [120/2] via 3.3.3.2, 00:00:20, Serial0/0/0
3.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 3.3.3.0/30 is directly connected, Serial0/0/0
L 3.3.3.1/32 is directly connected, Serial0/0/0
R 3.3.3.4/30 [120/1] via 3.3.3.2, 00:00:20, Serial0/0/0
R* 0.0.0.0/0 [120/1] via 3.3.3.2, 00:00:20, Serial0/0/0
R2
R2#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
R 1.0.0.0/8 [120/1] via 3.3.3.1, 00:00:22, Serial0/0/0
R 2.0.0.0/8 [120/1] via 3.3.3.6, 00:00:18, Serial0/0/1
3.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 3.3.3.0/30 is directly connected, Serial0/0/0
L 3.3.3.2/32 is directly connected, Serial0/0/0
C 3.3.3.4/30 is directly connected, Serial0/0/1
L 3.3.3.5/32 is directly connected, Serial0/0/1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Loopback0
L 10.10.10.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Loopback0
R3
R3#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 3.3.3.5 to network 0.0.0.0
R 1.0.0.0/8 [120/2] via 3.3.3.5, 00:00:11, Serial0/0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, GigabitEthernet0/0
L 2.2.2.1/32 is directly connected, GigabitEthernet0/0
3.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R 3.3.3.0/30 [120/1] via 3.3.3.5, 00:00:11, Serial0/0/0
C 3.3.3.4/30 is directly connected, Serial0/0/0
L 3.3.3.6/32 is directly connected, Serial0/0/0
R* 0.0.0.0/0 [120/1] via 3.3.3.5, 00:00:11, Serial0/0/0
PC1 테스트
C:\>ping 2.2.2.11
Pinging 2.2.2.11 with 32 bytes of data:
Request timed out.
Reply from 2.2.2.11: bytes=32 time=6ms TTL=125
Reply from 2.2.2.11: bytes=32 time=6ms TTL=125
Reply from 2.2.2.11: bytes=32 time=7ms TTL=125
Ping statistics for 2.2.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 7ms, Average = 6ms
C:\>ping 3.3.3.5
Pinging 3.3.3.5 with 32 bytes of data:
Reply from 3.3.3.5: bytes=32 time=10ms TTL=254
Reply from 3.3.3.5: bytes=32 time=5ms TTL=254
Reply from 3.3.3.5: bytes=32 time=5ms TTL=254
Reply from 3.3.3.5: bytes=32 time=7ms TTL=254
Ping statistics for 3.3.3.5:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 10ms, Average = 6ms
PC2 테스트
C:\>ping 1.1.1.11
Pinging 1.1.1.11 with 32 bytes of data:
Reply from 1.1.1.11: bytes=32 time=9ms TTL=125
Reply from 1.1.1.11: bytes=32 time=8ms TTL=125
Reply from 1.1.1.11: bytes=32 time=7ms TTL=125
Reply from 1.1.1.11: bytes=32 time=9ms TTL=125
Ping statistics for 1.1.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 7ms, Maximum = 9ms, Average = 8ms
C:\>ping 3.3.3.1
Pinging 3.3.3.1 with 32 bytes of data:
Reply from 3.3.3.1: bytes=32 time=6ms TTL=253
Reply from 3.3.3.1: bytes=32 time=9ms TTL=253
Reply from 3.3.3.1: bytes=32 time=13ms TTL=253
Reply from 3.3.3.1: bytes=32 time=6ms TTL=253
Ping statistics for 3.3.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 13ms, Average = 8ms
◾ Router에 RIP 설정 • 라우터가 알고있는 네트워크 정보를 광고하도록 지정한다. • Classful 알고리즘이므로 넷마스크를 입력하지 않는다. • 라우터에 연결된 모든 네트워크 정보를 모두 입력한다.
• 중간에 거쳐가는 라우터가 적은 쪽으로 이동
◾ 명령어 • router [rip | ospf | eigrp | bgp] : 각 프로토콜 설정모드로 진입 • network [IP] : 광고할 네트워크 주소를 지정 - 라우터에 연결된 모든 네트워크 주소를 입력한다. - rip은 넷마스크를 입력하지 않는다.
◾ 라우팅 정보 확인 • show ip route [rip]
◾ 불필요한 업데이트 금지 • R1이나 R2, R3의 GigbitEthernet 영역은 라우팅 정보를 수신할 라우터가 없는 곳이므로 해당 인터페이스로 라우팅 정보를 업데이트 할 필요가 없다. • passive‐interface [interface] : 해당 인터페이스로는 라우팅 정보를 업데이트하지 않는다.
R1(config-router)#passive-interface g0/0
RIP 실습
R1
R1(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.11.1 YES manual down down
Serial0/0/1 1.4.13.2 YES manual down down
Vlan1 unassigned YES unset administratively down down
R2
R2(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.2.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.11.2 YES manual up up
Serial0/0/1 1.4.12.1 YES manual down down
Vlan1 unassigned YES unset administratively down down
R3
R3#show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.3.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.13.1 YES manual up up
Serial0/0/1 1.4.12.2 YES manual up up
Vlan1 unassigned YES unset administratively down down
라우터 RIP 설정
R1, R2, R3 모두 설정한다.
R1(config)#router rip
R1(config-router)#network 1.4.1.0
R1(config-router)#network 1.4.11.0
R1(config-router)#network 1.4.13.0
R1(config-router)#passive-interface g0/0 < 불필요한 업데이트 금지
라우터 RIP 설정 확인
R1#show start
...
router rip
network 1.0.0.0
...
라우팅 정보 확인
R1#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/8 is variably subnetted, 9 subnets, 2 masks
C 1.4.1.0/24 is directly connected, GigabitEthernet0/0
L 1.4.1.1/32 is directly connected, GigabitEthernet0/0
R 1.4.2.0/24 [120/1] via 1.4.11.2, 00:00:27, Serial0/0/0
R 1.4.3.0/24 [120/1] via 1.4.13.1, 00:00:08, Serial0/0/1
C 1.4.11.0/24 is directly connected, Serial0/0/0
L 1.4.11.1/32 is directly connected, Serial0/0/0
R 1.4.12.0/24 [120/1] via 1.4.11.2, 00:00:27, Serial0/0/0
[120/1] via 1.4.13.1, 00:00:08, Serial0/0/1
C 1.4.13.0/24 is directly connected, Serial0/0/1
L 1.4.13.2/32 is directly connected, Serial0/0/1
PC에서 테스트
PC1
C:\>ping 1.4.2.11
Pinging 1.4.2.11 with 32 bytes of data:
Request timed out.
Reply from 1.4.2.11: bytes=32 time=5ms TTL=126
Reply from 1.4.2.11: bytes=32 time=6ms TTL=126
Reply from 1.4.2.11: bytes=32 time=5ms TTL=126
Ping statistics for 1.4.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 6ms, Average = 5ms
C:\>ping 1.4.3.11
Pinging 1.4.3.11 with 32 bytes of data:
Reply from 1.4.3.11: bytes=32 time=8ms TTL=126
Reply from 1.4.3.11: bytes=32 time=6ms TTL=126
Reply from 1.4.3.11: bytes=32 time=7ms TTL=126
Reply from 1.4.3.11: bytes=32 time=6ms TTL=126
Ping statistics for 1.4.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 6ms, Maximum = 8ms, Average = 6ms
RIP - extra
◾ 변경 정보 전달(Route Poisoning, Poisoning Reverse) • 라우터에 변경(장애나 수정)이 발생하면 즉시 수정된 라우팅 정보를 전달한다. • 이때 접근 이 불가능한 16 hops를 전달한다. • R3의 G0/0을 다운시키고 전달되는 라우팅 정보를 확인한다.
R1#debug ip rip
RIP protocol debugging is on
R1#RIP: sending v1 update to 255.255.255.255 via Serial0/0/0 (1.4.11.1)
RIP: build update entries
network 1.4.1.0 metric 1
network 1.4.3.0 metric 2
network 1.4.13.0 metric 1
RIP: sending v1 update to 255.255.255.255 via Serial0/0/1 (1.4.13.2)
RIP: build update entries
network 1.4.1.0 metric 1
network 1.4.2.0 metric 2
network 1.4.11.0 metric 1
RIP: received v1 update from 1.4.13.1 on Serial0/0/1
1.4.2.0 in 2 hops
1.4.3.0 in 1 hops
1.4.12.0 in 1 hops
RIP: received v1 update from 1.4.11.2 on Serial0/0/0
1.4.2.0 in 1 hops
1.4.3.0 in 2 hops
1.4.12.0 in 1 hops
RIP: sending v1 update to 255.255.255.255 via Serial0/0/0 (1.4.11.1)
RIP: build update entries
network 1.4.1.0 metric 1
network 1.4.3.0 metric 2
network 1.4.13.0 metric 1
RIP: sending v1 update to 255.255.255.255 via Serial0/0/1 (1.4.13.2)
RIP: build update entries
network 1.4.1.0 metric 1
network 1.4.2.0 metric 2
network 1.4.11.0 metric 1
RIP: received v1 update from 1.4.13.1 on Serial0/0/1
1.4.2.0 in 2 hops
1.4.3.0 in 1 hops
1.4.12.0 in 1 hops
RIP: received v1 update from 1.4.11.2 on Serial0/0/0
1.4.2.0 in 1 hops
1.4.3.0 in 2 hops
1.4.12.0 in 1 hops
...
R1#no debug ip rip
RIP protocol debugging is off
RIP - extra : default route
◾ RIP을 이용한 default route 정보 전달 • 정적 라우팅 환경에서는 라우터에 직접 default route 정보를 설정했으나 RIP에서는 default route 정보를 RIP를 통해 전달 가능하다. • 명령 [ default‐information originate ] : RIP을 통해 default route 정보를 전달한다.
◾ Default router 설정 • default route 설정은 정적 라우팅 설정과 동일하다. • 외부 네트워크로 local loopback 인터페이스를 이용한다. (가짜 인터페이스를 생성) - loopback 인터페이스를 인터넷(ISP) 연결로 간주한다. (default route로 지정)
- no shutdown 으로 활성화를 할 필요가 없다. (가짜 인터페이스라서)
◾ loopback 인터페이스를 활성화 한다.
• 가상 인터페이스로 no shutdown 명령이 불필요하다. • 10.10.10.0/24는 RIP 라우팅에 등록하지 않는다.
R1(config)#int loopback0
R1(config-if)#
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 10.10.10.1 255.255.255.0
R1(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.11.1 YES manual up up
Serial0/0/1 1.4.13.2 YES manual up up
Loopback0 10.10.10.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
◾ default route 인터페이스를 지정하고 이를 rip이 광고하도록 설정
R1(config)#ip route 0.0.0.0 0.0.0.0 loopback0
%Default route without gateway, if not a point-to-point interface, may impact performance
R1(config)#router rip
R1(config-router)#default-information originate
R1(config-router)#exit
R1(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
1.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C 1.4.1.0/24 is directly connected, GigabitEthernet0/0
L 1.4.1.1/32 is directly connected, GigabitEthernet0/0
R 1.4.2.0/24 [120/1] via 1.4.11.2, 00:00:20, Serial0/0/0
R 1.4.3.0/24 [120/1] via 1.4.13.1, 00:00:24, Serial0/0/1
C 1.4.11.0/24 is directly connected, Serial0/0/0
L 1.4.11.1/32 is directly connected, Serial0/0/0
R 1.4.12.0/24 [120/1] via 1.4.13.1, 00:00:24, Serial0/0/1
[120/1] via 1.4.11.2, 00:00:20, Serial0/0/0
C 1.4.13.0/24 is directly connected, Serial0/0/1
L 1.4.13.2/32 is directly connected, Serial0/0/1
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, Loopback0
L 10.10.10.1/32 is directly connected, Loopback0
S* 0.0.0.0/0 is directly connected, Loopback0
R2, R3에서도 default route 정보가 갱신되었는지 확인
R2#show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 1.4.11.1 to network 0.0.0.0
1.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
R 1.4.1.0/24 [120/1] via 1.4.11.1, 00:00:08, Serial0/0/0
C 1.4.2.0/24 is directly connected, GigabitEthernet0/0
L 1.4.2.1/32 is directly connected, GigabitEthernet0/0
R 1.4.3.0/24 [120/1] via 1.4.12.2, 00:00:26, Serial0/0/1
C 1.4.11.0/24 is directly connected, Serial0/0/0
L 1.4.11.2/32 is directly connected, Serial0/0/0
C 1.4.12.0/24 is directly connected, Serial0/0/1
L 1.4.12.1/32 is directly connected, Serial0/0/1
R 1.4.13.0/24 [120/1] via 1.4.12.2, 00:00:26, Serial0/0/1
[120/1] via 1.4.11.1, 00:00:08, Serial0/0/0
R* 0.0.0.0/0 [120/1] via 1.4.11.1, 00:00:08, Serial0/0/0
R1(config)#int g0/0
R1(config-if)#ip address 1.4.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#int s0/0/0
R1(config-if)#ip address 1.4.4.1 255.255.255.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#int s0/0/1
R1(config-if)#ip address 1.4.5.1 255.255.255.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
R1(config)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.1.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.4.1 YES manual up up
Serial0/0/1 1.4.5.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
R2
R2(config)#int g0/0
R2(config-if)#ip address 1.4.2.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R2(config-if)#int s0/0/0
R2(config-if)#ip address 1.4.4.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
R2(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.2.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.4.2 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
R3
R3(config)#int g0/0
R3(config-if)#ip address 1.4.3.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R3(config-if)#int s0/0/0
R3(config-if)#ip address 1.4.5.2 255.255.255.0
R3(config-if)#no sh
R3(config)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 1.4.3.1 YES manual up up
GigabitEthernet0/1 unassigned YES unset administratively down down
Serial0/0/0 1.4.5.2 YES manual up up
Serial0/0/1 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down down
라우팅 설정
R1
R1(config)#ip route 1.4.2.0 255.255.255.0 1.4.4.2
R1(config)#ip route 1.4.3.0 255.255.255.0 1.4.5.2
R1(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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/8 is variably subnetted, 8 subnets, 2 masks
C 1.4.1.0/24 is directly connected, GigabitEthernet0/0
L 1.4.1.1/32 is directly connected, GigabitEthernet0/0
S 1.4.2.0/24 [1/0] via 1.4.4.2
S 1.4.3.0/24 [1/0] via 1.4.5.2
C 1.4.4.0/24 is directly connected, Serial0/0/0
L 1.4.4.1/32 is directly connected, Serial0/0/0
C 1.4.5.0/24 is directly connected, Serial0/0/1
L 1.4.5.1/32 is directly connected, Serial0/0/1
R2
R2(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
1.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 1.4.2.0/24 is directly connected, GigabitEthernet0/0
L 1.4.2.1/32 is directly connected, GigabitEthernet0/0
C 1.4.4.0/24 is directly connected, Serial0/0/0
L 1.4.4.2/32 is directly connected, Serial0/0/0
S* 0.0.0.0/0 is directly connected, Serial0/0/0
R3
R3(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R3(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
1.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 1.4.3.0/24 is directly connected, GigabitEthernet0/0
L 1.4.3.1/32 is directly connected, GigabitEthernet0/0
C 1.4.5.0/24 is directly connected, Serial0/0/0
L 1.4.5.2/32 is directly connected, Serial0/0/0
S* 0.0.0.0/0 is directly connected, Serial0/0/0
TEST
PC1
C:\>ping 1.4.1.12
Pinging 1.4.1.12 with 32 bytes of data:
Reply from 1.4.1.12: bytes=32 time<1ms TTL=128
Reply from 1.4.1.12: bytes=32 time<1ms TTL=128
Reply from 1.4.1.12: bytes=32 time<1ms TTL=128
Reply from 1.4.1.12: bytes=32 time=3ms TTL=128
Ping statistics for 1.4.1.12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 3ms, Average = 0ms
C:\>ping 1.4.2.12
Pinging 1.4.2.12 with 32 bytes of data:
Request timed out.
Reply from 1.4.2.12: bytes=32 time=7ms TTL=126
Reply from 1.4.2.12: bytes=32 time=4ms TTL=126
Reply from 1.4.2.12: bytes=32 time=4ms TTL=126
Ping statistics for 1.4.2.12:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 7ms, Average = 5ms
C:\>ping 1.4.2.11
Pinging 1.4.2.11 with 32 bytes of data:
Request timed out.
Reply from 1.4.2.11: bytes=32 time=5ms TTL=126
Reply from 1.4.2.11: bytes=32 time=4ms TTL=126
Reply from 1.4.2.11: bytes=32 time=4ms TTL=126
Ping statistics for 1.4.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 5ms, Average = 4ms
C:\>ping 1.4.3.11
Pinging 1.4.3.11 with 32 bytes of data:
Request timed out.
Reply from 1.4.3.11: bytes=32 time=4ms TTL=126
Reply from 1.4.3.11: bytes=32 time=5ms TTL=126
Reply from 1.4.3.11: bytes=32 time=8ms TTL=126
Ping statistics for 1.4.3.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 8ms, Average = 5ms
C:\>ping 1.4.3.12
Pinging 1.4.3.12 with 32 bytes of data:
Request timed out.
Reply from 1.4.3.12: bytes=32 time=1ms TTL=126
Reply from 1.4.3.12: bytes=32 time=1ms TTL=126
Reply from 1.4.3.12: bytes=32 time=4ms TTL=126
Ping statistics for 1.4.3.12:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 4ms, Average = 2ms
PC2
C:\>ping 1.4.1.11
Pinging 1.4.1.11 with 32 bytes of data:
Reply from 1.4.1.11: bytes=32 time=6ms TTL=126
Reply from 1.4.1.11: bytes=32 time=4ms TTL=126
Reply from 1.4.1.11: bytes=32 time=4ms TTL=126
Reply from 1.4.1.11: bytes=32 time=4ms TTL=126
Ping statistics for 1.4.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 6ms, Average = 4ms
C:\>ping 1.4.3.11
Pinging 1.4.3.11 with 32 bytes of data:
Reply from 1.4.3.11: bytes=32 time=10ms TTL=125
Reply from 1.4.3.11: bytes=32 time=5ms TTL=125
Reply from 1.4.3.11: bytes=32 time=5ms TTL=125
Reply from 1.4.3.11: bytes=32 time=5ms TTL=125
Ping statistics for 1.4.3.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 10ms, Average = 6ms
PC3
C:\>ping 1.4.1.12
Pinging 1.4.1.12 with 32 bytes of data:
Request timed out.
Reply from 1.4.1.12: bytes=32 time=4ms TTL=126
Reply from 1.4.1.12: bytes=32 time=7ms TTL=126
Reply from 1.4.1.12: bytes=32 time=4ms TTL=126
Ping statistics for 1.4.1.12:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 4ms, Maximum = 7ms, Average = 5ms
C:\>ping 1.4.2.12
Pinging 1.4.2.12 with 32 bytes of data:
Reply from 1.4.2.12: bytes=32 time=10ms TTL=125
Reply from 1.4.2.12: bytes=32 time=5ms TTL=125
Reply from 1.4.2.12: bytes=32 time=9ms TTL=125
Reply from 1.4.2.12: bytes=32 time=5ms TTL=125
Ping statistics for 1.4.2.12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 5ms, Maximum = 10ms, Average = 7ms
◾ Router : 서로 다른 네트워크 연결 장치 (어떤 패킷이 어느 포트로 나갈지 계산하는 것)
• 물리적인 환경(Link layer)과는 무관하게 네트워크 ID(네트워크 주소)가 다른 네트워크를 연결한다. • 라우팅이 지원되는 프로토콜에서 사용 가능하다. - IP, IPX 등 • 라우팅을 제공하는 장치는 라우터 이외에도 거의 모든 네트워크가 지원되는 OS에서 가능하다. - 리눅스, 유닉스, 윈도우 등등
◾ Routing protocol
• static • RIP • OSPF
• IGRP • EIGRP • BGP
* TCP/IP 에서 Gateway : 우리 네트워크에서 다른 네트워크로 나갈때 거치는 지점 (ex. 라우터, 방화벽)
◾ Distance Vector • Hop count base • RIP
◾ Link-State • Cost base • OSPF, IS-IS
◾ Advanced Distance Vector • EIGRP
◾ Classful > 지금 사용X • Subnet mask를 교환하지 않는다. (*subnet mask : ip주소에서 네트워크 주소를 결정 짓는것) • RIP, IGRP (인터넷 초창기에 사용)
0 01 90 100 110 120 170 255(never be used) : 경로 찾을 수X
◾ 다양한 구조의 네트워크에서 Router가 사용되며 최근에는 방화벽과 라우터가 하나의 장비로 구성되는 경우도 있다.
(방화벽과 라우터는 다른 장비)
◾ 게이트웨이 • 라우터 • 방화벽
◾ 초기 인터넷에서 모든 단위 네트워크의 구분에 라우터가 이용되었으나 IP 고갈등의 문제로 ISP의 상당수 서비스는 라우터를 기반으로하지 않는다. • 중소규모의 최종 사용자 네트워크에 라우터가 점점 쓰이지 않는다. • Router간 연결이나 ISP 연결 환경이 serial에서 광이나 UTP와 같은 LAN 매체로 바뀌고 있다.
정적(Static) 라우팅
◾ 정적 라우팅
: 모든 경로에 대한 정보를 직접 관리자가 입력해주는 방식 • 단순 경로 네트워크나 단일 외부 경로를 가진 최종 사용자 네트워크에 매우 유용하다. • 라우터 장치 이외에 리눅스나 유닉스 윈도우즈등의 OS에서도 기본적인 기능으로 제공된다. - 일반 PC나 서버도 로컬 라우터로 이용할 수 있다.
* C class 는 최대한 64개로 쪼개서 줄 수 있음
(호스트 개수가 256/64=4 이므로 첫번째랑 마지막은 네트워크 주소와 브로드캐스트주소이므로 2개의 IP 만 사용할 수 있으므로)
라우터 사이 빨강 선 : WAN에서 사용하는 시리얼 라인
정적 라우팅 실습
◾ 라우터 설정하기
R1, R2의 IP주소를 세팅
R1(config)#int g0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#int s0/0/0
R1(config-if)#ip address 192.168.3.1 255.255.255.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
PC1에서 테스트
다른 컴퓨터로 통신이 안되는 것을 확인할 수 있다.
C:\>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Reply from 192.168.1.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.3.1
Pinging 192.168.3.1 with 32 bytes of data:
Reply from 192.168.3.1: bytes=32 time<1ms TTL=255
Reply from 192.168.3.1: bytes=32 time<1ms TTL=255
Reply from 192.168.3.1: bytes=32 time<1ms TTL=255
Reply from 192.168.3.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.3.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.3.2
Pinging 192.168.3.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.3.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
◾ 정적 라우팅 - 라우팅 정보 입력
TEST • PC1_1에서 ~3.2까지는 연결이 가능하지만 ~2.0으로는 패킷이 전달되지 않는다. • PC2_1에서도 ~1.0/24까지는 연결 불가다.
• R1, R2에 추가적인 라우팅 정보를 정적으로 입력해준다. • 명령 ip route [dst IP] [dst netmask] [next_ip | exit_interface] ex) ip route 192.168.2.0 255.255.255.0 192.168.3.2
R1
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
R1(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
S 192.168.2.0/24 [1/0] via 192.168.3.2
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, Serial0/0/0
L 192.168.3.1/32 is directly connected, Serial0/0/0
R2
R2(config)#ip route 192.168.1.0 255.255.255.0 serial0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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
S 192.168.1.0/24 is directly connected, Serial0/0/0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/0
L 192.168.2.1/32 is directly connected, GigabitEthernet0/0
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, Serial0/0/0
L 192.168.3.2/32 is directly connected, Serial0/0/0
PC1에서 테스트
통신이 잘 되는 것을 확인할 수 있다.
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Request timed out.
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 4ms, Average = 3ms
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Reply from 192.168.2.11: bytes=32 time=6ms TTL=126
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 6ms, Average = 4ms
◾ 정적 라우팅 - Default 라우팅
Default 라우팅 • 모든 네트워크 정보를 모두 입력할 수 없음으로 기본 라우팅 정보를 입력한다. • 명령 ip route 0.0.0.0 0.0.0.0 [next_ip | exit_interface]
(0.0.0.0 : 모든 네트워크 정보) ex) ip route 0.0.0.0 0.0.0.0 serial0/0/0 • 0.0.0.0 : 쿼드 제로 네트워크 주소및 서브넷마스크 - 라우팅 정보가 없는 모든 네트워크와 서브넷마스크를 의미한다. - 라우팅 경로가 다중 경로인 경우 default 경로가 지정되더라도 경로 지정이 필요하다. - 인터넷 단일 경로 라우터의 경우 매우 유용하다.
R1 라우팅
R1(config)#no ip route 192.168.2.0 255.255.255.0 192.168.3.2
R1(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R1(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, Serial0/0/0
L 192.168.3.1/32 is directly connected, Serial0/0/0
S* 0.0.0.0/0 is directly connected, Serial0/0/0
R1
R2(config)#no ip route 192.168.1.0 255.255.255.0 serial0/0/0
R2(config)#ip route 0.0.0.0 0.0.0.0 serial0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)#do show ip route
Codes: L - local, 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, E - EGP
i - IS-IS, 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 0.0.0.0 to network 0.0.0.0
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/0
L 192.168.2.1/32 is directly connected, GigabitEthernet0/0
192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.3.0/24 is directly connected, Serial0/0/0
L 192.168.3.2/32 is directly connected, Serial0/0/0
S* 0.0.0.0/0 is directly connected, Serial0/0/0
PC1에서 테스트
C:\>ping 192.168.2.11
Pinging 192.168.2.11 with 32 bytes of data:
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=3ms TTL=126
Reply from 192.168.2.11: bytes=32 time=4ms TTL=126
Reply from 192.168.2.11: bytes=32 time=2ms TTL=126
Ping statistics for 192.168.2.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 4ms, Average = 3ms
sw1(config)#int vlan2
sw1(config-if)#
%LINK-5-CHANGED: Interface Vlan2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to up
sw1(config-if)#ip address 192.168.12.102 255.255.255.0
sw1(config-if)#no shutdown
sw1(config-if)#exit
sw1(config)#inter
sw1(config)#interface vlan3
sw1(config-if)#
%LINK-5-CHANGED: Interface Vlan3, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan3, changed state to up
sw1(config-if)#ip address 192.168.13.103 255.255.255.0
sw1(config-if)#no shutdown
sw1(config-if)#exit
sw1(config)#exit
sw1#
%SYS-5-CONFIG_I: Configured from console by console
sw1#copy runn
sw1#copy running-config start
sw1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
sw1#
Telnet 접속 설정
sw1(config)#line vty 0 4
sw1(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
sw1(config-line)#password kitri03
PC4에서 telnet 접속
자신의 VLAN에서만 접속이 가능하다. 다른 VLAN 접속은 못한다.
C:\>telnet 192.168.12.102
Trying 192.168.12.102 ...Open
User Access Verification
Password:
sw1>exit
[Connection to 192.168.12.102 closed by foreign host]
C:\>telnet 192.168.13.103
Trying 192.168.13.103 ...
% Connection timed out; remote host not responding
C:\>
sw2(config)#vlan 10
sw2(config-vlan)#name vlan10
sw2(config-vlan)#exit
sw2(config)#vlan 20
sw2(config-vlan)#name vlan20
sw2(config-vlan)#exit
sw2(config)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 vlan10 active
20 vlan20 active
VLAN 포트 설정
sw1(config)#interface range fa0/10-14
sw1(config-if-range)#switchport access vlan 10
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#exit
sw1(config)#int range fa0/20-24
sw1(config-if-range)#switchport access vlan 20
sw1(config-if-range)#switchport mode access
sw1(config-if-range)#exit
sw1(config)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Gig0/1, Gig0/2
10 vlan10 active Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14
20 vlan20 active Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
sw1(config)#int g0/1
sw1(config-if)#sw ac vlan 10
sw1(config-if)#sw mode ac
sw1(config-if)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Gig0/2
10 vlan10 active Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Gig0/1
20 vlan20 active Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
sw2(config)#int g0/2
sw2(config-if)#
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/2 (1), with sw1 GigabitEthernet0/2 (20).
sw2(config-if)#sw ac vlan 20
sw2(config-if)#sw mode access
sw2(config-if)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19
10 vlan10 active Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Gig0/1
20 vlan20 active Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig0/2
테스트는 컴퓨터에서 각 vlan별로 통신이 되는지 확인
◾ 여러 스위치에서 VLAN 간 통신 실습 - TRUNK
Trunk 는 모든 VLAN의 패킷을 전송
sw1, sw2 둘다 설정
sw1(config)#int g0/1
sw1(config-if)#no sw mode access
Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.
sw1(config-if)#no switchport access vlan 10
sw1(config-if)#switchport mode trunk
sw1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
sw1(config-if)#do show int trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
Port Vlans allowed on trunk
Gig0/1 1-1005
Port Vlans allowed and active in management domain
Gig0/1 1,10,20
Port Vlans in spanning tree forwarding state and not pruned
Gig0/1 none
테스트는 컴퓨터에서 각 vlan별로 통신이 되는지 확인
PC1_1에서 PC1_2로 테스트
C:\>ping 1.1.1.12
Pinging 1.1.1.12 with 32 bytes of data:
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Reply from 1.1.1.12: bytes=32 time<1ms TTL=128
Ping statistics for 1.1.1.12:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
S0(config)#vlan 10
S0(config-vlan)#name vlan10
S0(config-vlan)#vlan 20
S0(config-vlan)#name vlan20
S0(config-vlan)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
Gig0/1, Gig0/2
10 vlan10 active
20 vlan20 active
...
S0(config)#int range f0/10-14, g0/1
S0(config-if-range)#switch access vlan 10
S0(config-if-range)#switchport mode access
S0(config-if-range)#int range f0/20-24, g0/2
S0(config-if-range)#sw ac vlan 20
S0(config-if-range)#sw mode access
S0(config-if-range)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19
10 vlan10 active Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14, Gig0/1
20 vlan20 active Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gig0/2
라우터 설정
R0(config)#interface g0/0
R0(config-if)#ip address 192.168.10.1 255.255.255.0
R0(config-if)#no shut
R0(config-if)#no shutdown
R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R0(config-if)#int g0/1
R0(config-if)#ip address 192.168.20.1 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
R0(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.10.1 YES manual up up
GigabitEthernet0/1 192.168.20.1 YES manual up up
Vlan1 unassigned YES unset administratively down down
테스트는 PC에서 진행한다.
PC1, PC2에서 둘다 진행하면 ping이 잘 가는 것을 확인할 수 있다.
C:\>ping 192.168.10.1
Pinging 192.168.10.1 with 32 bytes of data:
Reply from 192.168.10.1: bytes=32 time=19ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.10.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 19ms, Average = 4ms
C:\>ping 192.168.20.1
Pinging 192.168.20.1 with 32 bytes of data:
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.20.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
◾ VLAN Routing Trunk 실습
◾ VLAN간에 통신은 반드시 L3 장치를 통해서 가능하다. • VLAN 10 : 192.168.10.0/24 : fa10 ~ fa14 • VLAN 20 : 192.168.20.0/24 : fa20 ~ fa14 • S0 gi0/1는 R0의 gi0/0에 연결. - 트렁크로 지정 VLAN 10,20의 GW로 사용한다. - R0의 gi0/0에 IP를 두 개 설정한다.
Switch 설정
S0(config)#interface range gi0/1-2
S0(config-if-range)#no sw ac vlan
S0(config-if-range)#do show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/15, Fa0/16, Fa0/17
Fa0/18, Fa0/19, Gig0/1, Gig0/2
10 vlan10 active Fa0/10, Fa0/11, Fa0/12, Fa0/13
Fa0/14
20 vlan20 active Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
Router 설정
S0(config)#int g0/1
S0(config-if)#sw mode trunk
S0(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
S0(config-if)#do show int trunk
Port Mode Encapsulation Status Native vlan
Gig0/1 on 802.1q trunking 1
이전 실습의 ip를 해제한다.
R0(config)#int g0/0
R0(config-if)#no ip address
R0(config-if)#no ip address
R0(config-if)#shutdown
R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
R0(config-if)#int g0/1
R0(config-if)#no ip address
R0(config-if)#shutdown
R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to administratively down
R0(config-if)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES manual administratively down down
GigabitEthernet0/1 unassigned YES manual administratively down down
Vlan1 unassigned YES unset administratively down down
라우터에 가상 인터페이스를 생성해 ip를 할당한다.
R0(config)#int g0/0
R0(config-if)#no shutdown
R0(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R0(config-if)#int g0/0.10
R0(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.10, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.10, changed state to up
R0(config-subif)#encapsulation dot1q 10
R0(config-subif)#ip address 192.168.10.1 255.255.255.0
R0(config-subif)#int g0/0.20
R0(config-subif)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0.20, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0.20, changed state to up
R0(config-subif)#encapsulation dot1q 20
R0(config-subif)#ip address 192.168.20.1 255.255.255.0
R0(config-subif)#do show ip int brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES manual up up
GigabitEthernet0/0.10 192.168.10.1 YES manual up up
GigabitEthernet0/0.20 192.168.20.1 YES manual up up
GigabitEthernet0/1 unassigned YES manual administratively down down
Vlan1 unassigned YES unset administratively down down
PC에서 테스트
C:\>ping 192.168.10.1
Pinging 192.168.10.1 with 32 bytes of data:
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Reply from 192.168.10.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.10.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.20.1
Pinging 192.168.20.1 with 32 bytes of data:
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Reply from 192.168.20.1: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.20.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms