mirror of
https://github.com/jung-geun/policy-routing.git
synced 2025-12-20 02:34:39 +09:00
README.md에 로컬 자동 PBR 시스템 구성 섹션 추가 및 packer-openstack-ubuntu.json 파일 생성
This commit is contained in:
20
README.md
20
README.md
@@ -13,6 +13,8 @@ NIC 의 ip 설정이 미리 되어 있어야 합니다.
|
|||||||
|
|
||||||
# 사용 방법
|
# 사용 방법
|
||||||
|
|
||||||
|
## 로컬에 자동 PBR 시스템 구성
|
||||||
|
|
||||||
스크립트는 아래 명령어로 다운로드 받을 수 있습니다
|
스크립트는 아래 명령어로 다운로드 받을 수 있습니다
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -20,3 +22,21 @@ wget -O policy_routing.py https://git.dmslab.xyz/dmslab/policy-routing/-/raw/mai
|
|||||||
# or
|
# or
|
||||||
curl -o policy_routing.py https://git.dmslab.xyz/dmslab/policy-routing/-/raw/main/policy_routing.py
|
curl -o policy_routing.py https://git.dmslab.xyz/dmslab/policy-routing/-/raw/main/policy_routing.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
다운로드한 스크립트를 install 옵션으로 시스템 데몬으로 설치할 수 있습니다
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo python3 policy_routing.py install
|
||||||
|
```
|
||||||
|
|
||||||
|
실제 인터페이스가 감지되고 수행이 되었는지 체크할 수 있습니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo python3 policy_routing.py status
|
||||||
|
```
|
||||||
|
|
||||||
|
ip rule 을 확인하여 정책 기반 라우팅이 설정되었는지 확인할 수 있습니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ip rule ls
|
||||||
|
```
|
||||||
65
packer-openstack-ubuntu.json
Normal file
65
packer-openstack-ubuntu.json
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
"variables": {
|
||||||
|
"openstack_auth_url": "{{env `OS_AUTH_URL`}}",
|
||||||
|
"openstack_username": "{{env `OS_USERNAME`}}",
|
||||||
|
"openstack_password": "{{env `OS_PASSWORD`}}",
|
||||||
|
"openstack_tenant_name": "{{env `OS_TENANT_NAME`}}",
|
||||||
|
"openstack_domain_name": "{{env `OS_USER_DOMAIN_NAME`}}",
|
||||||
|
"openstack_region": "{{env `OS_REGION_NAME`}}",
|
||||||
|
"source_image_id": "{{env `OS_SOURCE_IMAGE_ID`}}",
|
||||||
|
"flavor_name": "cpu.2c_2g",
|
||||||
|
"network_name": "{{env `OS_NETWORK_NAME`}}",
|
||||||
|
"image_name": "ubuntu 22.04-{{timestamp}} server",
|
||||||
|
"floating_ip_pool": "{{env `OS_FLOATING_IP_POOL`}}",
|
||||||
|
"ssh_username": "ubuntu"
|
||||||
|
},
|
||||||
|
"builders": [
|
||||||
|
{
|
||||||
|
"type": "openstack",
|
||||||
|
"identity_endpoint": "{{user `openstack_auth_url`}}",
|
||||||
|
"username": "{{user `openstack_username`}}",
|
||||||
|
"password": "{{user `openstack_password`}}",
|
||||||
|
"tenant_name": "{{user `openstack_tenant_name`}}",
|
||||||
|
"domain_name": "{{user `openstack_domain_name`}}",
|
||||||
|
"region": "{{user `openstack_region`}}",
|
||||||
|
"image_name": "{{user `image_name`}}",
|
||||||
|
"source_image": "{{user `source_image_id`}}",
|
||||||
|
"flavor": "{{user `flavor_name`}}",
|
||||||
|
"networks": [
|
||||||
|
"{{user `network_name`}}"
|
||||||
|
],
|
||||||
|
"ssh_username": "{{user `ssh_username`}}",
|
||||||
|
"security_groups": [
|
||||||
|
"default"
|
||||||
|
],
|
||||||
|
"floating_ip_pool": "private_provider",
|
||||||
|
"use_floating_ip": true,
|
||||||
|
"ssh_timeout": "10m",
|
||||||
|
"image_disk_format": "raw",
|
||||||
|
"use_blockstorage_volume": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"provisioners": [
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"inline": [
|
||||||
|
"sudo apt-get update",
|
||||||
|
"sudo apt-get upgrade -y",
|
||||||
|
"sudo apt-get autoremove -y",
|
||||||
|
"echo 'Initial system updates and cleanup complete.'"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "pbr-script-cloud-init.yaml",
|
||||||
|
"destination": "/tmp/pbr-script-cloud-init.yaml"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"inline": [
|
||||||
|
"sudo mv /tmp/pbr-script-cloud-init.yaml /etc/cloud/cloud.cfg.d/99-custom-pbr-script.cfg",
|
||||||
|
"echo 'Cloud-init configuration moved to /etc/cloud/cloud.cfg.d/'"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user