예: MX 시리즈 라우터에서 OpenFlow 활성화
OpenFlow는 경로를 따라 각 디바이스의 플로우를 생성, 삭제 및 수정하여 네트워크의 트래픽 경로를 제어할 수 있는 개방형 표준입니다. 이 예는 Junos OS 실행하는 MX240 라우터에서 OpenFlow 지원을 구성하는 방법을 보여줍니다.
요구 사항
이 예는 다음과 같은 하드웨어 및 소프트웨어 구성 요소를 사용합니다.
릴리스 13.3 이상 Junos OS 실행하는 MX240 라우터
설치된 디바이스의 Junos OS 릴리스와 일치하는 소프트웨어 패키지 릴리스가 포함된 OpenFlow 소프트웨어 패키지
라우터와 OpenFlow 컨트롤러 간의 TCP 연결
OpenFlow 컨트롤러 IP 주소에서 연결할 수 있는 라우터의 관리 인터페이스와 관리 네트워크 간의 연결
개요
이 예에서는 MX240 라우터에서 OpenFlow에 대한 지원을 구성합니다. 라우터에는 Ge-1/0/0.0, ge-1/1/0.0, xe-0/0/0.0 등 3개의 인터페이스가 있습니다. 먼저 물리적 링크 레이어 캡슐화 유형 ethernet-bridge
및 프로토콜 체계 bridge
를 사용하여 인터페이스를 레이어 2 인터페이스로 구성합니다.
MX 시리즈 라우터는 OpenFlow 트래픽을 일반 네트워크 트래픽으로부터 격리하기 위해 별도의 가상 스위치 라우팅 인스턴스를 필요로 합니다. 이 예는 계층 수준에서 인스턴스 유형을 virtual-switch
사용하여 가상 스위치 라우팅 인스턴스인 rt-bd-1을 [edit routing-instances]
구성합니다. 라우팅 인스턴스 내에서 브리지 도메인 of-bridge
은 OpenFlow에 참여하는 모든 논리적 인터페이스를 포함합니다.
계층 수준에서 OpenFlow 가상 스위치 및 OpenFlow 프로토콜 문을 구성합니다 [edit protocols openflow]
. 이 예에서 가상 스위치 OFswitch1은 IP 주소 172.16.1.1에서 TCP 연결을 통해 컨트롤러에 연결합니다. 가상 스위치 구성에는 OpenFlow에 참여하는 모든 논리적 인터페이스가 포함되어야 하며, OpenFlow 트래픽은 이러한 인터페이스에서만 진입 또는 종료됩니다.
OpenFlow 구성 내에서 문은 default-action
일치하는 플로우 항목이 없는 패킷에 대해 스위치가 취해야 하는 작업을 나타냅니다. 명령문을 생략 default-action
하면, 기본 행동은 입니다 packet-in
. 이는 일치하는 플로우 입력이 없는 패킷이 처리를 위해 컨트롤러로 전송되어야 함을 나타냅니다. 이 예에서는 일치하는 플로우 항목이 없는 패킷에 대한 기본 작업을 로 packet-in
명시적으로 구성합니다.
이 예에서는 OpenFlow traceoptions도 구성합니다. 이 경우 문은 flag all
모든 OpenFlow 추적 이벤트를 캡처하고 기록해야 함을 나타냅니다. 예제가 로그 파일에 대한 특정 파일 이름을 구성하지 않기 때문에 OpenFlow 추적 메시지는 기본 OpenFlow 로그 파일 /var/log/ofd에 기록됩니다.
구성
CLI 빠른 구성
이 예를 빠르게 구성하려면, 아래 명령을 복사하여 텍스트 파일로 붙여 넣은 다음 모든 라인브러브를 제거하고, 네트워크 구성을 일치하는 데 필요한 세부 사항을 바꾸고 계층 수준에서 명령을 CLI [edit]
로 복사해 붙여 넣은 다음, 구성 모드에서 을(를) 입력 commit
합니다.
set interfaces ge-1/0/0 encapsulation ethernet-bridge unit 0 family bridge set interfaces ge-1/1/0 encapsulation ethernet-bridge unit 0 family bridge set interfaces xe-0/0/0 encapsulation ethernet-bridge unit 0 family bridge set routing-instances rt-bd-1 instance-type virtual-switch set routing-instances rt-bd-1 bridge-domains of-bridge vlan-id none set routing-instances rt-bd-1 bridge-domains of-bridge interface ge-1/0/0.0 set routing-instances rt-bd-1 bridge-domains of-bridge interface ge-1/1/0.0 set routing-instances rt-bd-1 bridge-domains of-bridge interface xe-0/0/0.0 set protocols openflow switch OFswitch1 controller address 172.16.1.1 set protocols openflow switch OFswitch1 controller protocol tcp set protocols openflow switch OFswitch1 interfaces ge-1/0/0.0 set protocols openflow switch OFswitch1 interfaces ge-1/1/0.0 set protocols openflow switch OFswitch1 interfaces xe-0/0/0.0 set protocols openflow switch OFswitch1 default-action packet-in set protocols openflow traceoptions flag all
절차
단계별 절차
OpenFlow 지원 구성 방법:
OpenFlow 인터페이스를 레이어 2 인터페이스로 구성합니다.
[edit interfaces] user@host# set ge-1/0/0 encapsulation ethernet-bridge unit 0 family bridge user@host# set ge-1/1/0 encapsulation ethernet-bridge unit 0 family bridge user@host# set xe-0/0/0 encapsulation ethernet-bridge unit 0 family bridge
가상 스위치 라우팅 인스턴스를 구성합니다.
[edit routing-instances] user@host# set rt-bd-1 instance-type virtual-switch user@host# set rt-bd-1 bridge-domains of-bridge vlan-id none user@host# set rt-bd-1 bridge-domains of-bridge interface ge-1/0/0.0 user@host# set rt-bd-1 bridge-domains of-bridge interface ge-1/1/0.0 user@host# set rt-bd-1 bridge-domains of-bridge interface xe-0/0/0.0
OpenFlow 컨트롤러 IP 주소 및 연결 프로토콜을 구성합니다.
[edit protocols openflow switch OFswitch1] user@host# set controller address 172.16.1.1 user@host# set controller protocol tcp
이 가상 스위치 인스턴스에서 OpenFlow에 참여하는 논리적 인터페이스를 구성합니다.
[edit protocols openflow switch OFswitch1] user@host# set interfaces ge-1/0/0.0 user@host# set interfaces ge-1/1/0.0 user@host# set interfaces xe-0/0/0.0
일치하는 플로우 항목이 없는 패킷에 대한 기본 작업을 구성합니다.
[edit protocols openflow switch OFswitch1] user@host# set default-action packet-in
OpenFlow traceoptions를 구성합니다.
[edit protocols openflow] user@host# set traceoptions flag all
구성을 커밋합니다.
[edit] user@host# commit
결과
구성 모드에서 , show protocols openflow
및 show routing-instances
명령을 입력하여 구성을 show interfaces
확인합니다. 출력에 의도한 구성이 표시되지 않으면 이 예의 지침을 반복하여 구성을 수정합니다.
user@host# show interfaces ge-1/0/0 { encapsulation ethernet-bridge; unit 0 { family bridge; } } ge-1/1/0 { encapsulation ethernet-bridge; unit 0 { family bridge; } } xe-0/0/0 { encapsulation ethernet-bridge; unit 0 { family bridge; } }
user@host# show protocols openflow switch OFswitch1 { default-action packet-in; interfaces { ge-1/0/0.0; ge-1/1/0.0; xe-0/0/0.0; } controller { address 172.16.1.1; protocol tcp; } } traceoptions { flag all; }
user@host# show routing-instances rt-bd-1 { instance-type virtual-switch; bridge-domains { of-bridge { vlan-id none; interface ge-1/0/0.0; interface ge-1/1/0.0; interface xe-0/0/0.0; } } }
확인
구성이 제대로 작동하는지 확인합니다.
OpenFlow 컨트롤러 연결이 작동 중인지 확인
목적
OpenFlow 컨트롤러 연결이 작동 중인지 확인합니다.
작업
show openflow controller
운영 모드 명령을 발행하고 컨트롤러 연결 상태가 인지 확인합니다up
. 가상 스위치 구성에는 하나의 컨트롤러만 있으므로 구성을 커밋한 후 가상 스위치 자동으로 컨트롤러에 대한 연결을 시작해야 합니다.
user@host> show openflow controller Openflowd controller information: Controller socket: 11 Controller IP address: 172.16.1.1 Controller protocol: tcp Controller port: 6633 Controller connection state: up Number of connection attempt: 1 Controller role: equal
의미
출력은 OpenFlow 컨트롤러의 연결 상태가 컨트롤러에 대한 다른 정보 외에도 임을 up
보여줍니다.
OpenFlow 인터페이스가 작동 중인지 확인
목적
OpenFlow 인터페이스가 작동 중인지 확인합니다.
작업
show openflow interfaces
운영 모드 명령을 발행하고 각 OpenFlow 인터페이스의 상태가 인지 확인합니다Up
.
user@host> show openflow interfaces Switch name: OFswitch1 Interface Name: ge-1/0/0.0 Interface port number: 41507 Interface Hardware Address: 00:00:5e:00:53:b1 Interface speed: 1Gb Full-duplex Interface Auto-Negotiation: Disabled Interface media type: Fiber Interface state: Up Switch name: OFswitch1 Interface Name: ge-1/1/0.0 Interface port number: 44538 Interface Hardware Address: 00:00:5e:00:53:b2 Interface speed: 1Gb Full-duplex Interface Auto-Negotiation: Disabled Interface media type: Fiber Interface state: Up Switch name: OFswitch1 Interface Name: xe-0/0/0.0 Interface port number: 45549 Interface Hardware Address: 00:00:5e:00:53:b3 Interface speed: 10Gb Full-duplex Interface Auto-Negotiation: Disabled Interface media type: Fiber Interface state: Up
의미
출력은 각 OpenFlow 인터페이스의 상태가 인터페이스에 대한 다른 정보 외에도 임을 Up
보여줍니다.