ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • NFS, Dynamic PAT 등을 활용한 실습
    Infrastructure 2020. 5. 29. 15:58

    NFS, Dynamic PAT 등을 활용한 실습

    웹서버 백업 및 본사를 통한 인터넷 통신

    HQ

    config t
    # 초기 설정
    int fa0/0
    ip add 211.183.3.3 255.255.255.0
    no sh
    int fa1/0
    ip add 192.168.0.26 255.255.255.0
    no sh
    int fa0/1
    no sh
    # sub-interface에서 VLAN 10 담당
    int fa0/1.10
    encap dot1Q 10
    ip add 192.168.1.2 255.255.255.0
    exit
    # 정적 라우팅
    ip route 192.168.2.0 255.255.255.0 192.168.0.22
    ip route 192.168.3.0 255.255.255.0 192.168.0.22
    # default routing
    ip route 0.0.0.0 0.0.0.0 211.183.3.2
    # ACL 생성
    access-list 1 permit 192.168.1.0 0.0.0.255
    access-list 2 permit 192.168.2.0 0.0.0.255
    access-list 3 permit 192.168.3.0 0.0.0.255
    access-list 99 permit host 192.168.0.22
    # telnet 설정
    enable password test123
    line vty 0 4
    password test123
    login
    access-class 99 in
    exit
    # IP pool 생성
    ip nat pool 1 211.183.3.11 211.183.3.11 prefix-length 24
    ip nat pool 2 211.183.3.12 211.183.3.12 prefix-length 24
    ip nat pool 3 211.183.3.13 211.183.3.13 prefix-length 24
    # dynamic PAT
    ip nat inside source list 1 pool 1 overload
    ip nat inside source list 2 pool 2 overload
    ip nat inside source list 3 pool 3 overload
    # static NAT
    ip nat inside source static 192.168.1.100 211.183.3.100
    # outside 정의
    int fa0/0
    ip nat outside
    # inside 정의
    int range fa1/0 , fa0/1
    ip nat inside

    HQ_SW

    erase flash
    config t
    vlan dat
    vlan 10 name WEB
    exit
    int fa1/1
    sw acc vlan 10
    no sh
    int fa1/10
    sw mode trunk

    Web server

    yum -y install httpd nfs-utils
    setenforce 0
    systemctl stop firewalld
    systemctl start httpd
    mkdir /storage
    mount -t nfs 192.168.2.100:/external /storage
    vi /etc/cron.hourly/backup.sh

    backup.sh

    #!/bin/sh
    
    FROM_DIR="/home"
    TO_DIR="/storage"
    DATE=`date +%H%M%S`
    BACKUP_FILE=backup_${DATE}.tar.gz
    tar zcfP ${TO_DIR}/${BACKUP_FILE} ${FROM_DIR}

    결과

    'Infrastructure' 카테고리의 다른 글

    CRON  (0) 2020.05.29
    Subnetting  (0) 2020.05.28
    VPN  (0) 2020.05.28
    HSRP  (0) 2020.05.28
    GRE  (0) 2020.05.28
Designed by Tistory.