SlideShare a Scribd company logo
Junchol Park
Principal Internet Sales Consultant
Oracle Digital Prime Tech Presales
2020.09
Secondary VNIC & Secondary Private IP
for Linux
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
1
Secondary Private IP 및 Secondary VNIC
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
2
• Secondary Private IP Address
 이용 중인 VNIC의 VCN 및 Subnet 내 IP만 할당 가능
 이용 목적
 Reserved Public IP(고정 IP) 이용
 인스턴스 장애 조치 : 새로운 인스턴스에 이전 Private IP/Reserved Public IP 설정
 단일 인스턴스에 여러 서비스 또는 엔드 포인트 실행
• Secondary VNIC
 다른 VCN 또는 다른 Subnet내 IP도 할당 가능
 이용 목적
 인스턴스를 여러 VCN의 Subnet에 연결하는게 목적
Secondary Private IP Address
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
3
Secondary Private IP Address 할당
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
4
동일 VCN 내의 IP만 등록 가능
Secondary Private IP Address 할당
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
5
참고
https://docs.cloud.oracle.com/en-us/iaas/Content/Network/Tasks/managingIPaddresses.htm#Linux
스크립트를 사용하여 OS 구성
• 추가 명령어
ip addr add <address>/<subnet_prefix_len> dev <phys_dev> label <phys_dev>:<addr_seq_num>
<address>: The secondary private IP address.
<subnet_prefix_len>: The subnet's prefix length. For example, if the subnet is 192.168.20.0/24, the subnet prefix length is 24.
<phys_dev>: The interface to add the address to (for example, ens2f0).
<addr_seq_num>: The sequential number in the stack of addresses on the device (for example, 0).
예) sudo ip addr add 10.0.0.3/24 dev ens3
• 삭제 명령어
sudo ip addr del 10.0.0.3/24 dev ens3
• 인스턴스 재부팅시 초기화됨
재부팅에도 유지하기 위해서는 /etc/sysconfig/network-scripts/ifcfg-<phys_dev>:<addr_seq_num> 에 설정을 하여야 함
Secondary Private IP Address 할당
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
6
Linux OS에서 할당한 IP를 OS명령어로 추가
현재 등록된 IP 조회
[opc@proxy ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3
valid_lft 85924sec preferred_lft 85924sec
[opc@proxy ~]$ ip route
default via 10.0.0.1 dev ens3
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15
169.254.0.0/16 dev ens3 proto static scope link
169.254.0.0/16 dev ens3 scope link metric 1002
[opc@proxy ~]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 ens3
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
Secondary Private IP Address 할당
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
7
ens3 Interface에 보조 Private IP 추가
[opc@proxy ~]$ sudo ip addr add 10.0.0.3/24 dev ens3
[opc@proxy ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3
valid_lft 85886sec preferred_lft 85886sec
inet 10.0.0.3/24 scope global secondary ens3
valid_lft forever preferred_lft forever
Secondary Private IP Address 제거
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
8
[opc@proxy ~]$ sudo ip addr del 10.0.0.3/24 dev ens3
다음 명령어 실행 후, Console에서 삭제
서버 재부팅에도 Secondary Private IP Address 할당 유지
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
9
다음 파일에 설정 추가
/etc/sysconfig/network-scripts/ifcfg-<phys_dev>:<addr_seq_num>
[opc@proxy ~]$ sudo touch /etc/sysconfig/network-scripts/ifcfg-ens3:0
[opc@proxy ~]$ sudo vi /etc/sysconfig/network-scripts/ifcfg-ens3:0
DEVICE="ens3:0"
BOOTPROTO=static
IPADDR=10.0.0.3
NETMASK=255.255.255.0
ONBOOT=yes
[opc@proxy ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3
valid_lft 86337sec preferred_lft 86337sec
inet 10.0.0.3/24 brd 10.0.0.255 scope global secondary ens3:0
valid_lft forever preferred_lft forever
재부팅 후 결과 확인
Secondary VNIC
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
10
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
11
다른 VCN 또는 다른 subnet 선택 가능
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
12
참고
https://docs.cloud.oracle.com/en-us/iaas/Content/Network/Tasks/managingVNICs.htm#Linux
스크립트를 사용하여 OS 구성
• 스크립트 다운로드
$ wget http://docs.cloud.oracle.com/en-us/iaas/Content/Resources/Assets/secondary_vnic_all_configure.sh
• 실행 가능하도록 설정
$ chmod +x secondary_vnic_all_configure.sh
• 스크립트 실행 방법
$ secondary_vnic_all_configure.sh -c : Configure (adds or deletes) secondary VNIC host IP configuration
$ secondary_vnic_all_configure.sh -c -n : Same but uses separate namespaces
$ secondary_vnic_all_configure.sh -d : Force removes all secondary VNIC host IP configuration
• 인스턴스 재부팅시 초기화됨
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
13
[opc@proxy ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3
valid_lft 86380sec preferred_lft 86380sec
3: ens5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
[opc@proxy ~]$ ip route
default via 10.0.0.1 dev ens3
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15
169.254.0.0/16 dev ens3 proto static scope link
169.254.0.0/16 dev ens3 scope link metric 1002
[opc@proxy ~]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 ens3
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
현재 현황
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
14
[opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh
CONFIG ADDR SPREFIX SBITS VIRTRT NS IND IFACE VLTAG VLAN STATE MAC VNIC
- 10.0.0.15 10.0.0.0 24 10.0.0.1 - 0 ens3 - - UP 02:00:17:00:e0:80 ocid1.vnic.oc1.ap-
seoul-1.abuwgljr6kumxxfo6khot4pmtm4mm4bjmosscmh6h7wgli6bqrx7ajsoe3ra
ADD 20.0.0.2 20.0.0.0 24 20.0.0.1 - 1 ens5 - - DOWN 02:00:17:00:fb:84 ocid1.vnic.oc1.ap-
seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka
[opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh -c
Info: adding IP config for VNIC MAC 02:00:17:00:fb:84 with id ocid1.vnic.oc1.ap-seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka
Info: added IP address 20.0.0.2 on interface ens5 with MTU 9000
Info: added rule for routing from 20.0.0.2 lookup ort1 with default via 20.0.0.1
VNIC 추가
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
15
[opc@proxy ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3
valid_lft 86042sec preferred_lft 86042sec
3: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:17:00:fb:84 brd ff:ff:ff:ff:ff:ff
inet 20.0.0.2/24 scope global ens5
valid_lft forever preferred_lft forever
[opc@proxy ~]$ ip route
default via 10.0.0.1 dev ens3
10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15
20.0.0.0/24 dev ens5 proto kernel scope link src 20.0.0.2
169.254.0.0/16 dev ens3 proto static scope link
169.254.0.0/16 dev ens3 scope link metric 1002
추가된 상황
Secondary VNIC 추가
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
16
[opc@proxy ~]$ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
default gateway 0.0.0.0 UG 0 0 0 ens3
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3
20.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens5
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
[opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh
CONFIG ADDR SPREFIX SBITS VIRTRT NS IND IFACE VLTAG VLAN STATE MAC VNIC
- 10.0.0.15 10.0.0.0 24 10.0.0.1 - 0 ens3 - - UP 02:00:17:00:e0:80 ocid1.vnic.oc1.ap-
seoul-1.abuwgljr6kumxxfo6khot4pmtm4mm4bjmosscmh6h7wgli6bqrx7ajsoe3ra
- 20.0.0.2 20.0.0.0 24 20.0.0.1 - 1 ens5 - - UP 02:00:17:00:fb:84 ocid1.vnic.oc1.ap-
seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka
추가된 상황
Secondary VNIC 제거
Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted
17
스크립트 실행 후, OCI Console에서 제거
[opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh -d
Info: removing IP config of address 20.0.0.2 for VNIC MAC 02:00:17:00:fb:84 with id ocid1.vnic.oc1.ap-seoul-
1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka
Info: removed routing on interface ens5
Info: removed IP address 20.0.0.2 from interface ens5

More Related Content

What's hot

CCNA 1 Routing and Switching v5.0 Chapter 8
CCNA 1 Routing and Switching v5.0 Chapter 8CCNA 1 Routing and Switching v5.0 Chapter 8
CCNA 1 Routing and Switching v5.0 Chapter 8
Nil Menon
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @Cloudflare
C4Media
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
Shu Sugimoto
 
Automate DBA Tasks With Ansible
Automate DBA Tasks With AnsibleAutomate DBA Tasks With Ansible
Automate DBA Tasks With Ansible
Ivica Arsov
 
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
Trainocate Japan, Ltd.
 
CCNP Security-Secure
CCNP Security-SecureCCNP Security-Secure
CCNP Security-Secure
mohannadalhanahnah
 
Ccnp presentation day 4 sd-access vs traditional network architecture
Ccnp presentation   day 4  sd-access vs traditional network architectureCcnp presentation   day 4  sd-access vs traditional network architecture
Ccnp presentation day 4 sd-access vs traditional network architecture
SagarR24
 
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
Ji-Woong Choi
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
Codership Oy - Creators of Galera Cluster
 
ACI MultiPod Config Guide
ACI MultiPod Config GuideACI MultiPod Config Guide
ACI MultiPod Config Guide
Woo Hyung Choi
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
PgDay.Seoul
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf
Jo Hoon
 
Vyatta and Virtualization 仮想環境でのVyatta
Vyatta and Virtualization 仮想環境でのVyattaVyatta and Virtualization 仮想環境でのVyatta
Vyatta and Virtualization 仮想環境でのVyatta
Kentaro Ebisawa
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
Altinity Ltd
 
The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
NATS
 
DHCP Ubuntu
DHCP UbuntuDHCP Ubuntu
DHCP Ubuntu
Sergio Santos
 
HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and Keepalived
Ganapathi Kandaswamy
 
Fuzzing Linux Kernel
Fuzzing Linux KernelFuzzing Linux Kernel
Fuzzing Linux Kernel
Piyush Mishra
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
Padraig O'Sullivan
 
Aula04 - configuração da topologia ppp - resolvido
Aula04 -  configuração da topologia ppp - resolvidoAula04 -  configuração da topologia ppp - resolvido
Aula04 - configuração da topologia ppp - resolvido
Carlos Veiga
 

What's hot (20)

CCNA 1 Routing and Switching v5.0 Chapter 8
CCNA 1 Routing and Switching v5.0 Chapter 8CCNA 1 Routing and Switching v5.0 Chapter 8
CCNA 1 Routing and Switching v5.0 Chapter 8
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @Cloudflare
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
Automate DBA Tasks With Ansible
Automate DBA Tasks With AnsibleAutomate DBA Tasks With Ansible
Automate DBA Tasks With Ansible
 
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
今さら聞けない! Windows Server 2012 R2 Active Directory入門【グローバルナレッジ無料セミナー資料】
 
CCNP Security-Secure
CCNP Security-SecureCCNP Security-Secure
CCNP Security-Secure
 
Ccnp presentation day 4 sd-access vs traditional network architecture
Ccnp presentation   day 4  sd-access vs traditional network architectureCcnp presentation   day 4  sd-access vs traditional network architecture
Ccnp presentation day 4 sd-access vs traditional network architecture
 
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
 
ACI MultiPod Config Guide
ACI MultiPod Config GuideACI MultiPod Config Guide
ACI MultiPod Config Guide
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf[GitOps] Argo CD on GKE (v0.9.2).pdf
[GitOps] Argo CD on GKE (v0.9.2).pdf
 
Vyatta and Virtualization 仮想環境でのVyatta
Vyatta and Virtualization 仮想環境でのVyattaVyatta and Virtualization 仮想環境でのVyatta
Vyatta and Virtualization 仮想環境でのVyatta
 
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
New features in ProxySQL 2.0 (updated to 2.0.9) by Rene Cannao (ProxySQL)
 
The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
 
DHCP Ubuntu
DHCP UbuntuDHCP Ubuntu
DHCP Ubuntu
 
HA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and KeepalivedHA Deployment Architecture with HAProxy and Keepalived
HA Deployment Architecture with HAProxy and Keepalived
 
Fuzzing Linux Kernel
Fuzzing Linux KernelFuzzing Linux Kernel
Fuzzing Linux Kernel
 
Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
 
Aula04 - configuração da topologia ppp - resolvido
Aula04 -  configuração da topologia ppp - resolvidoAula04 -  configuração da topologia ppp - resolvido
Aula04 - configuração da topologia ppp - resolvido
 

Similar to Linux에서 Secondary VNIC와 Secondary Private IP 추가 방법

Solaris 11 network virtualization & Server Virtualization for cloud
Solaris 11 network virtualization & Server Virtualization for cloudSolaris 11 network virtualization & Server Virtualization for cloud
Solaris 11 network virtualization & Server Virtualization for cloud
suk kim
 
Enterprise Linux 7 new feature_network configuration
Enterprise Linux 7 new feature_network configurationEnterprise Linux 7 new feature_network configuration
Enterprise Linux 7 new feature_network configuration
suk kim
 
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
Ji-Woong Choi
 
Lam pstack
Lam pstackLam pstack
Lam pstack
DooNa Lee
 
Build the OpenStack Cloud with Neutron Networing, IceHouse
Build the OpenStack Cloud with Neutron Networing, IceHouseBuild the OpenStack Cloud with Neutron Networing, IceHouse
Build the OpenStack Cloud with Neutron Networing, IceHouse
jieun kim
 
Solaris11 기초 자료
Solaris11 기초 자료Solaris11 기초 자료
Solaris11 기초 자료
Dong-Hwa jung
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee docker
DK Lee
 
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
wonyong hwang
 
Nginx Https 적용하기.pptx
Nginx Https 적용하기.pptxNginx Https 적용하기.pptx
Nginx Https 적용하기.pptx
wonyong hwang
 
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
Red Hat OpenStack 17 저자직강+스터디그룹_2주차Red Hat OpenStack 17 저자직강+스터디그룹_2주차
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
Nalee Jang
 
KAFKA 3.1.0.pdf
KAFKA 3.1.0.pdfKAFKA 3.1.0.pdf
KAFKA 3.1.0.pdf
wonyong hwang
 
20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제
Tae Young Lee
 
Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
John Kim
 
Before OTD EDU Assignments
Before OTD EDU AssignmentsBefore OTD EDU Assignments
Before OTD EDU Assignments
Beom Lee
 
Mininet
MininetMininet
Mininet
ymtech
 
ACL - cisco 2811 router
ACL - cisco 2811 router ACL - cisco 2811 router
ACL - cisco 2811 router
준기 홍
 
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
흥배 최
 
Cubietruck 리눅스 이미지 설치
Cubietruck 리눅스 이미지 설치Cubietruck 리눅스 이미지 설치
Cubietruck 리눅스 이미지 설치
ymtech
 
Wiki academy sysadmin 6_day
Wiki academy sysadmin 6_dayWiki academy sysadmin 6_day
Wiki academy sysadmin 6_day
Jo Hoon
 
PCF Installation Guide
PCF Installation GuidePCF Installation Guide
PCF Installation Guide
seungdon Choi
 

Similar to Linux에서 Secondary VNIC와 Secondary Private IP 추가 방법 (20)

Solaris 11 network virtualization & Server Virtualization for cloud
Solaris 11 network virtualization & Server Virtualization for cloudSolaris 11 network virtualization & Server Virtualization for cloud
Solaris 11 network virtualization & Server Virtualization for cloud
 
Enterprise Linux 7 new feature_network configuration
Enterprise Linux 7 new feature_network configurationEnterprise Linux 7 new feature_network configuration
Enterprise Linux 7 new feature_network configuration
 
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
[오픈소스컨설팅]RHEL7/CentOS7 Pacemaker기반-HA시스템구성-v1.0
 
Lam pstack
Lam pstackLam pstack
Lam pstack
 
Build the OpenStack Cloud with Neutron Networing, IceHouse
Build the OpenStack Cloud with Neutron Networing, IceHouseBuild the OpenStack Cloud with Neutron Networing, IceHouse
Build the OpenStack Cloud with Neutron Networing, IceHouse
 
Solaris11 기초 자료
Solaris11 기초 자료Solaris11 기초 자료
Solaris11 기초 자료
 
20141229 dklee docker
20141229 dklee docker20141229 dklee docker
20141229 dklee docker
 
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
 
Nginx Https 적용하기.pptx
Nginx Https 적용하기.pptxNginx Https 적용하기.pptx
Nginx Https 적용하기.pptx
 
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
Red Hat OpenStack 17 저자직강+스터디그룹_2주차Red Hat OpenStack 17 저자직강+스터디그룹_2주차
Red Hat OpenStack 17 저자직강+스터디그룹_2주차
 
KAFKA 3.1.0.pdf
KAFKA 3.1.0.pdfKAFKA 3.1.0.pdf
KAFKA 3.1.0.pdf
 
20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제20141029 하둡2.5와 hive설치 및 예제
20141029 하둡2.5와 hive설치 및 예제
 
Nginx basic configurations
Nginx basic configurationsNginx basic configurations
Nginx basic configurations
 
Before OTD EDU Assignments
Before OTD EDU AssignmentsBefore OTD EDU Assignments
Before OTD EDU Assignments
 
Mininet
MininetMininet
Mininet
 
ACL - cisco 2811 router
ACL - cisco 2811 router ACL - cisco 2811 router
ACL - cisco 2811 router
 
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
KGC 2016 오픈소스 네트워크 엔진 Super socket 사용하기
 
Cubietruck 리눅스 이미지 설치
Cubietruck 리눅스 이미지 설치Cubietruck 리눅스 이미지 설치
Cubietruck 리눅스 이미지 설치
 
Wiki academy sysadmin 6_day
Wiki academy sysadmin 6_dayWiki academy sysadmin 6_day
Wiki academy sysadmin 6_day
 
PCF Installation Guide
PCF Installation GuidePCF Installation Guide
PCF Installation Guide
 

Linux에서 Secondary VNIC와 Secondary Private IP 추가 방법

  • 1. Junchol Park Principal Internet Sales Consultant Oracle Digital Prime Tech Presales 2020.09 Secondary VNIC & Secondary Private IP for Linux Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 1
  • 2. Secondary Private IP 및 Secondary VNIC Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 2 • Secondary Private IP Address  이용 중인 VNIC의 VCN 및 Subnet 내 IP만 할당 가능  이용 목적  Reserved Public IP(고정 IP) 이용  인스턴스 장애 조치 : 새로운 인스턴스에 이전 Private IP/Reserved Public IP 설정  단일 인스턴스에 여러 서비스 또는 엔드 포인트 실행 • Secondary VNIC  다른 VCN 또는 다른 Subnet내 IP도 할당 가능  이용 목적  인스턴스를 여러 VCN의 Subnet에 연결하는게 목적
  • 3. Secondary Private IP Address Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 3
  • 4. Secondary Private IP Address 할당 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 4 동일 VCN 내의 IP만 등록 가능
  • 5. Secondary Private IP Address 할당 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 5 참고 https://docs.cloud.oracle.com/en-us/iaas/Content/Network/Tasks/managingIPaddresses.htm#Linux 스크립트를 사용하여 OS 구성 • 추가 명령어 ip addr add <address>/<subnet_prefix_len> dev <phys_dev> label <phys_dev>:<addr_seq_num> <address>: The secondary private IP address. <subnet_prefix_len>: The subnet's prefix length. For example, if the subnet is 192.168.20.0/24, the subnet prefix length is 24. <phys_dev>: The interface to add the address to (for example, ens2f0). <addr_seq_num>: The sequential number in the stack of addresses on the device (for example, 0). 예) sudo ip addr add 10.0.0.3/24 dev ens3 • 삭제 명령어 sudo ip addr del 10.0.0.3/24 dev ens3 • 인스턴스 재부팅시 초기화됨 재부팅에도 유지하기 위해서는 /etc/sysconfig/network-scripts/ifcfg-<phys_dev>:<addr_seq_num> 에 설정을 하여야 함
  • 6. Secondary Private IP Address 할당 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 6 Linux OS에서 할당한 IP를 OS명령어로 추가 현재 등록된 IP 조회 [opc@proxy ~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3 valid_lft 85924sec preferred_lft 85924sec [opc@proxy ~]$ ip route default via 10.0.0.1 dev ens3 10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15 169.254.0.0/16 dev ens3 proto static scope link 169.254.0.0/16 dev ens3 scope link metric 1002 [opc@proxy ~]$ netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 ens3 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3
  • 7. Secondary Private IP Address 할당 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 7 ens3 Interface에 보조 Private IP 추가 [opc@proxy ~]$ sudo ip addr add 10.0.0.3/24 dev ens3 [opc@proxy ~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3 valid_lft 85886sec preferred_lft 85886sec inet 10.0.0.3/24 scope global secondary ens3 valid_lft forever preferred_lft forever
  • 8. Secondary Private IP Address 제거 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 8 [opc@proxy ~]$ sudo ip addr del 10.0.0.3/24 dev ens3 다음 명령어 실행 후, Console에서 삭제
  • 9. 서버 재부팅에도 Secondary Private IP Address 할당 유지 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 9 다음 파일에 설정 추가 /etc/sysconfig/network-scripts/ifcfg-<phys_dev>:<addr_seq_num> [opc@proxy ~]$ sudo touch /etc/sysconfig/network-scripts/ifcfg-ens3:0 [opc@proxy ~]$ sudo vi /etc/sysconfig/network-scripts/ifcfg-ens3:0 DEVICE="ens3:0" BOOTPROTO=static IPADDR=10.0.0.3 NETMASK=255.255.255.0 ONBOOT=yes [opc@proxy ~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3 valid_lft 86337sec preferred_lft 86337sec inet 10.0.0.3/24 brd 10.0.0.255 scope global secondary ens3:0 valid_lft forever preferred_lft forever 재부팅 후 결과 확인
  • 10. Secondary VNIC Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 10
  • 11. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 11 다른 VCN 또는 다른 subnet 선택 가능
  • 12. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 12 참고 https://docs.cloud.oracle.com/en-us/iaas/Content/Network/Tasks/managingVNICs.htm#Linux 스크립트를 사용하여 OS 구성 • 스크립트 다운로드 $ wget http://docs.cloud.oracle.com/en-us/iaas/Content/Resources/Assets/secondary_vnic_all_configure.sh • 실행 가능하도록 설정 $ chmod +x secondary_vnic_all_configure.sh • 스크립트 실행 방법 $ secondary_vnic_all_configure.sh -c : Configure (adds or deletes) secondary VNIC host IP configuration $ secondary_vnic_all_configure.sh -c -n : Same but uses separate namespaces $ secondary_vnic_all_configure.sh -d : Force removes all secondary VNIC host IP configuration • 인스턴스 재부팅시 초기화됨
  • 13. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 13 [opc@proxy ~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3 valid_lft 86380sec preferred_lft 86380sec 3: ens5: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 [opc@proxy ~]$ ip route default via 10.0.0.1 dev ens3 10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15 169.254.0.0/16 dev ens3 proto static scope link 169.254.0.0/16 dev ens3 scope link metric 1002 [opc@proxy ~]$ netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 ens3 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3 현재 현황
  • 14. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 14 [opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh CONFIG ADDR SPREFIX SBITS VIRTRT NS IND IFACE VLTAG VLAN STATE MAC VNIC - 10.0.0.15 10.0.0.0 24 10.0.0.1 - 0 ens3 - - UP 02:00:17:00:e0:80 ocid1.vnic.oc1.ap- seoul-1.abuwgljr6kumxxfo6khot4pmtm4mm4bjmosscmh6h7wgli6bqrx7ajsoe3ra ADD 20.0.0.2 20.0.0.0 24 20.0.0.1 - 1 ens5 - - DOWN 02:00:17:00:fb:84 ocid1.vnic.oc1.ap- seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka [opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh -c Info: adding IP config for VNIC MAC 02:00:17:00:fb:84 with id ocid1.vnic.oc1.ap-seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka Info: added IP address 20.0.0.2 on interface ens5 with MTU 9000 Info: added rule for routing from 20.0.0.2 lookup ort1 with default via 20.0.0.1 VNIC 추가
  • 15. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 15 [opc@proxy ~]$ ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:e0:80 brd ff:ff:ff:ff:ff:ff inet 10.0.0.15/24 brd 10.0.0.255 scope global dynamic ens3 valid_lft 86042sec preferred_lft 86042sec 3: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000 link/ether 02:00:17:00:fb:84 brd ff:ff:ff:ff:ff:ff inet 20.0.0.2/24 scope global ens5 valid_lft forever preferred_lft forever [opc@proxy ~]$ ip route default via 10.0.0.1 dev ens3 10.0.0.0/24 dev ens3 proto kernel scope link src 10.0.0.15 20.0.0.0/24 dev ens5 proto kernel scope link src 20.0.0.2 169.254.0.0/16 dev ens3 proto static scope link 169.254.0.0/16 dev ens3 scope link metric 1002 추가된 상황
  • 16. Secondary VNIC 추가 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 16 [opc@proxy ~]$ netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default gateway 0.0.0.0 UG 0 0 0 ens3 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3 20.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens5 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3 link-local 0.0.0.0 255.255.0.0 U 0 0 0 ens3 [opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh CONFIG ADDR SPREFIX SBITS VIRTRT NS IND IFACE VLTAG VLAN STATE MAC VNIC - 10.0.0.15 10.0.0.0 24 10.0.0.1 - 0 ens3 - - UP 02:00:17:00:e0:80 ocid1.vnic.oc1.ap- seoul-1.abuwgljr6kumxxfo6khot4pmtm4mm4bjmosscmh6h7wgli6bqrx7ajsoe3ra - 20.0.0.2 20.0.0.0 24 20.0.0.1 - 1 ens5 - - UP 02:00:17:00:fb:84 ocid1.vnic.oc1.ap- seoul-1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka 추가된 상황
  • 17. Secondary VNIC 제거 Confidential – © 2019 Oracle Internal/Restricted/Highly Restricted 17 스크립트 실행 후, OCI Console에서 제거 [opc@proxy ~]$ sudo ./secondary_vnic_all_configure.sh -d Info: removing IP config of address 20.0.0.2 for VNIC MAC 02:00:17:00:fb:84 with id ocid1.vnic.oc1.ap-seoul- 1.abuwgljrgupat4lxyyvhy6y66q4a5zeeblihlhqr53yoxptoabavfh6mtuka Info: removed routing on interface ens5 Info: removed IP address 20.0.0.2 from interface ens5