기본 콘텐츠로 건너뛰기

7월, 2016의 게시물 표시

Tunneling, Tunneling Protocol 터널링, 터널링 프로토콜

[정보통신기술용어해설] 터널링 Tunneling, Tunneling Protocol   터널링, 터널링 프로토콜 1. 터널링 ㅇ [ 데이터통신 분야 ] - 데이터 스트림 을 인터넷 상에서 가상의 파이프 를 통해 전달시키는 기술 . 패킷 내에 터널링할 대상을 캡슐화 시켜 목적지까지 전송 ㅇ [ 양자 터널링 , pn 접합 ] ☞ 터널 다이오드 참조 - 낮은 에너지 를 갖는 입자 가, 에너지 가 높으나 공간 폭이 작은 포텐셜 장벽 을 횡단 2. [데이터통신] 터널링 기법 ㅇ 두 노드 또는 두 네트워크 간에 가상의 링크 ( VPN 등)를 형성하는 기법 - 하나의 프로토콜 이 다른 프로토콜 을 감싸는 캡슐화 기능을 통해 운반 ※ 일반적으로 터널링 기법은, - 하위 계층 데이터들을 동일 또는 상위 계층 패킷 안에 감싸서 운반하는 것 . 이는 엄격하게 계층화 된 프로토콜 들을 뒤집어 만들 수 있으므로, . 오버레이 네트워크 구성도 가능하게 함 3. [데이터통신] 주요 인터넷 터널링 보안 방식 ㅇ Layer 2 터널링 방식 ( 데이터링크 계층 ) : PPTP , L2TP , MPLS 등 - PPP 확장에 의한 터널링 구현 : PPTP , L2TP 등 (단, 데이터 암호화 기능 없음) . PPTP : MS社에서 개발하고, RFC 2637로 표준화 .. 암호화 를 위해 IPSec 을 함께 사용해야 함 . L2TP : PPTP 기능을 개선하여, 표준화 ( RFC 2661,3931) 됨 .. 암호화 를 위해 MS社의 MPPE를 함께 사용해야 함 .. 초기 VPN 구현에 광범위하게 사용되었으나, 지금은 IPSec , SSL/TLS 등에 의해 대체 ㅇ Layer 3 터널링 방식 ( IP 계층

vi 편집하기

[8] 편집하기 ① 복사, 붙이기, 합치기 - y (Yank) : 복사하기 - yy : 한 줄 전체의 내용을 복사한다 - 2yy : 두줄복사 - nyy : 현재 줄 이하로 n개의 줄을 복사한다 (n은 임의의 숫자, 2yy는 2줄 복사) - ynw : n개의 단어를 복사한다(y2w는 두 개의 단어를 복사) - yw : 한단어 복사 - y2w : 두단어 복사 - y$ : 현재 위치에서 그 줄의 끝까지 복사한다 - y0(y^) : 현재 위치에서 그 줄의 처음까지 복사한다 - yG : 현재 위치에서 파일의 끝까지 복사한다(G는 파일의 마지막 줄) - Y : 한 줄 전체의 내용을 복사한다 (yy 와 동일) ※ 마지막 명령어의 반복 - . : 마지막에 수행한 명령어를 반복한다. -2. : 명령어를 2번 반복한다. - p (Put or Paste) : 붙이기 - p : 버퍼에 저장된 내용을 커서의 오른쪽으로 붙여 넣는다. - 2p : 아래로(오른쪽으로) 두번 붙이기 - np : n번만큼 p 명령을 반복. 2p라면 버퍼의 내용을 두 번 붙여넣는다 - P : 위로(왼쪽으로) 붙이기 - 2P : 위로(왼쪽으로) 두번 붙이기 - nP : 버퍼에 저장된 내용을 커서의 왼쪽으로 붙여넣는다. 사용법은 p와 같다 - xp : 두 문자를 바꾸는 명령 - deep : 두 단어를 바꾸는 명령 - ddp : 두 줄을 바꾸는 명령 - J(Join) : 여러 줄의 내용을 한 줄로 합친다 - J : 현재줄을 윗줄에 붙인다. (두줄 합치기) - nJ : n개의 줄을 합쳐 한 줄로 만든다. 커서는 원본 문서의 마지막 줄의 첫번째 위치(합쳐진 줄에서는 중간)에 놓인다. 5J는 5줄로 이루어진 내용을 한 줄로 만든다 ② 지우기, 복구하기, 바꾸기 - dnw : n개의 단어를 지운다 - d$ : 커서가 있는 위치에서 그 줄의 끝까지 지우기 - D : 커서부터 줄의 끝까지 삭제합니다. (d$ 와 동일) - d (Delete) : 지우기 - dd : 현

Censtos 부팅 순서 바꾸기

vi /boot/grub/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE:  You have a /boot partition.  This means that #          all kernel and initrd paths are relative to /boot/, eg. #          root (hd0,0) #          kernel /vmlinuz-version ro root=/dev/mapper/vg_int-lv_root #          initrd /initrd-[generic-]version.img #boot=/dev/sda default=2 timeout=2 splashimage=(hd0,0)/grub/splash.xpm.gz #reboot #uname -r

Kernel thread sample source

참조:http://www.programering.com/a/MDN4IjMwATk.html #include #include #ifndef SLEEP_MILLI_SEC #define SLEEP_MILLI_SEC(nMilliSec)\ do { \ long timeout = (nMilliSec) * HZ / 1000; \ while(timeout > 0) \ { \ timeout = schedule_timeout(timeout); \ } \ }while(0); #endif static struct task_struct * MyThread = NULL; static int MyPrintk(void *data) {     char *mydata = kmalloc(strlen(data)+1,GFP_KERNEL);     memset(mydata,'\0',strlen(data)+1);     strncpy(mydata,data,strlen(data));     while(!kthread_should_stop())     {         SLEEP_MILLI_SEC(1000);         printk("%s\n",mydata);     }     kfree(mydata);     return 0; } static int __init init_kthread(void) {     MyThread = kthread_run(MyPrintk,"hello world","mythread");     return 0; } static void __exit exit_kthread(void) {     if(MyThread)     {         printk("stop MyThread\n");         kthread_stop(MyThread);     } } module_init(init_kthread);

yum install iperf Error

[root@]# yum install iperf Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile  * base: ftp.jaist.ac.jp  * extras: ftp.jaist.ac.jp  * updates: ftp.riken.jp No package iperf available. Error: Nothing to do #yum install epel-release # yum install iperf

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"

Centos network setting

수동 등록 방법 ifcoifng eth0 xxx.xxx.xxx.xxx route add default gw xxx.xxx.xxx.xxx vi /etc/resolve.conf nameserver xxx.xxx.xxx.xxx #ifconfig -a 파일로 저장하기 /etc/sysconfig/network-scripts/ifcfg-eth0 에 네트워크 카드를 위한 설정이 저장 된다. #--- eth0 네트워크 카드에 고정 IP 설정시 DEVICE=eth0 BOOTPROTO=none HWADDR=00:24:1D:71:21:5C ONBOOT=yes NETMASK=255.255.255.0 IPADDR=203.261.27.22 GATEWAY=203.261.27.1 TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes

우분투 rpm 설치 하기

sudo apt-get update sudo apt-get install alien alien이 설치되었다면 rpm을 deb로 변환해 주어야합니다. sudo alien -c ***.rpm 변환과정이 끝나면 ***.deb파일이 생성된 것을 볼 수 있습니다. 이제 deb파일을 설치하면 됩니다. sudo dpkg -i ***.deb CentOS 설치 RPM 설치/확인/제거 [ 편집 ] 설치 ★★ rpm -ivh 패키지명 확인 ★★ [1] rpm -qa | grep 패키지명 제거 ★★ rpm -ev 패키지명 업그레이드 rpm -Uvh 패키지명 → 업그레이드 명령어이지만 기존에 설치된 것이 없을 경우 설치된다. [2]

I can’t login to my FreeBSD via SSH by putty with my root account

“I can’t login to my FreeBSD via SSH by putty with my root account.” Login as: root Using keyboard-interactive authentication. Password: Access denied Using keyboard-interactive authentication. Password: “Saya tidak bisa masuk ke FreeBSD via SSH menggunakan Putty dengan akun root” Login as: root Using keyboard-interactive authentication. Password: Access denied Using keyboard-interactive authentication. Password: 1. Login to your machine as root directly, don’t remote it 2. Edit file named sshd config. It’s located at  /etc/ssh/ #vi /etc/ssh/sshd config 3. Find this line # Authentication: #LoginGraceTime 2m #PermitRootLogin no #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 4. Uncomment and change the line with bold # Authentication: #LoginGraceTime 2m PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 5. Restart ssd service #/etc/rc.d/sshd restart Stopping sshd. Waiting for PIDS: 1285. Starting sshd. 6. You shou

우분투 kernel 최신으로 업데이트 하기

우분투(Ubuntu) 3.19 커널(Kernel)로 업데이트하기. http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/ 64비트 설치 #wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/linux-headers-3.19.0-031900-generic_3.19.0-031900.201504091832_amd64.deb #wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/linux-headers-3.19.0-031900_3.19.0-031900.201504091832_all.deb #wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.19-vivid/linux-image-3.19.0-031900-generic_3.19.0-031900.201504091832_amd64.deb #dpkg -i linux-headers-3.19.0-*.deb linux-image-3.19.0-*.deb #reboot #uname -a 버전이 바뀌는지 보면된다. 다른 방법 잘 되지는 않는다. #uname -a #apt-get update #apt-get install -y --force-yes linux-headers-generic-lts-trusty linux-image-generic-lts-trusty

VSFTP 설정

우분투 설치 $ sudo apt-get install vsftpd # 설정 파일 열기 $ sudo vi /etc/vsftpd.conf # anonymous 유저 사용 불가 anonymous_enable=NO # 계정사용자 접속 가능 local_enable=YES # 업로드 가능 write_enable=YES # 디렉토리나 파일 생성시 umask 값 local_umask=022 # 접속시 메세지 ftpd_banner=Welcome to uzuro FTP service # 접속시 출력 메세지 설정 ( shell등을 이용해 접속시 ) # 사용자 홈디렉토리에 .message 파일에 작성 dirmessage_enable=YES # chroot 적용 # 아래와 같은 설정을 할 경우 사용자들은 자신의 계정에서 상위 디렉토리로 이동할수 없게된다. chroot_local_user=YES # 특정 사용자만을 Jail 설정할 경우 # chroot_list에 등록되어있는 계정에만 chroot가 적용 chroot_list_enable=YES chroot_list_file=/etc/vsftpd/chroot_list # 특정 사용자를 제외한 나머지 사용자만을 Jail 설정할 경우 # chroot_list에 등록된 계정을 제외한 나머지가 자신의 계정에 chroot가 걸림 chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd/chroot_list # 계정마다 동적으로 설정할 경우 # 아래와 같이 설정을 하게 되면 /etc/passwd 파일을 참고하여 jail 설정을 할 수 있게 됨 # /etc/passwd 파일을 수정하여 경로에 .을 찍게 되면 그 지점이 chroot지점이 됨 # theeye:x:600:100::/home/./theeye:/bin/bash chroot_local_user=YES passwd_chroot_enable

krping Source, Kernel RDMA

우분투 http://www.mellanox.com/page/mlnx_ofed_eula?mtag=linux_sw_drivers&mrequest=downloads&mtype=ofed&mver=MLNX_OFED-3.3-1.0.4.0&mname=MLNX_OFED_LINUX-3.3-1.0.4.0-ubuntu14.04-x86_64.tgz 레드햇 https://www.openfabrics.org/downloads/OFED/ 설치후 확인 /etc/init.d/openibd restart wget https://www.openfabrics.org/downloads/krping/krping.tgz MLNX_OFED_LINUX-3.1-1.0.3-ubuntu14.04-x86_64 ofa_kernel-3.1 http://git.openfabrics.org/?p=~sgrimberg/krping.git;a=summary insmod: ERROR: could not insert module rdma_krping.ko: Invalid parameters [ 2737.952631] rdma_krping: disagrees about version of symbol rdma_resolve_route [ 2737.952639] rdma_krping: Unknown symbol rdma_resolve_route (err -22) [ 2737.952644] rdma_krping: disagrees about version of symbol rdma_create_id [ 2737.952647] rdma_krping: Unknown symbol rdma_create_id (err -22) 도저이 뭘봐야 하나 오류만 있지 해결책이 없네 https://github.com/amaumene/mlnx-en-dkms/blob/master/ofed_scripts/create_Module.symvers.sh kernel 개발 추가 자료(

OpenSSL 이란 openssl update

SSL이란 Secure Socket Layer로 월드 와이드 웹 브라우저와 웹 서버 간에 데이터를 안전하게 주고 받기 위한 업계 표준 프로토콜을 의미한다. : 오픈소스 라이브러리(OpenSSL) 공식 홈페이지: https://www.openssl.org/ OpenSSL 사용법 http://roiztoy.blogspot.kr/2013/11/openssl.html SSL서비스 구축 및 OpenSSL http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=884976 명령어 : http://repien.tistory.com/36 1) openssl 버전 확인 openssl version 2) 키 생성 openssl genrsa -des3 -out 키이름.key 1024 : 3DES로 암호화. 비밀번호 설정 필요. 3) 암호화 하지 않고 키 생성 openssl genrsa -out 키이름.key 1024 3-1) 비밀키로 공개키 생성 openssl rsa -in 비밀키명.key -pubout -out 공개키명.key 4) 기존 비밀키에 패스워드 추가 openssl rsa -in out 키이름.key -des3 -out 새키이름.key 5) 기존 비밀키에 패스워드 제거 openssl rsa -in 키이름.key -out 새로운키이름.key 6) 키 내용 확인 openssl 키종류 -noout -text -in 키이름.key ex) openssl rsa -noout -text -in 키이름.key 7) 자체 서명 인증서 생성 openssl req -new -key 키이름.key -x509 -out 인증서이름.crt openssl req -new -x509 -nodes -sha1 -days 365 -key server.key -out server.crt Enter pass phrase for test.key:

MariaDB(mysql) 업데이트

설치된 버전 확인 #mysql --version mysql  Ver 15.1 Distrib 5.5.50-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 버전별 업데이트 방법 보기 https://downloads.mariadb.org/mariadb/repositories/#mirror=kaist 기존 설치 되어 있으면 제거 방법 완전 제거 옵션 잘 선택해서 사용하세요 #sudo apt-get purge mysql* mariadb* 이것 저것 잘 되지 않아서 한버 실행하고 하니 잘 설치됨 시간이 오래 걸림 sudo aptitude install -f * 재설치 할때 절차 - cd /var/lib - sudo service mysql stop - sudo cp -R mysql _mysql - sudo apt-get purge mysql* mariadb* - sudo rm -R mysql - sudo apt-get install mariadb-client mariadb-server - sudo cp -Ruv _mysql/. mysql/. - sudo mysql -u root -p ididityay! show databases - :D - sudo rm -R _mysql *5.5.50 업데이트 방법 소스리스트에 추가를 해서 업데이트 하는 방법 #sudo apt-get install software-properties-common #sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db #sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://ftp.kaist.ac.kr/mariadb/repo/5.5/ubuntu trusty main' #sudo apt-get update

리눅스 네트워 확인

* 네트웍 카드 확인 #lspci | grep Network #lspci | grep Ethernet #lspci | grep -i Mellanox * 현재 등록 네트웍 정보 #ifconfig * 물리적으로 등록 되어있는 네트웍 정보 모두 보기 #ifconfig -a * IP 등록 #ifconfig eth0 192.168.8.1 netmask 255.255.255.0 up *gateway 설정 #route add default gw 192.168.1.1 * 적용 확인 #ifconfig * 제거 #ifconfig eth0 down * route add route add -net 192.168.0.0/24 netmask 255.255.255.0 gw 192.168.0.1 route add -host 192.168.0.12 gw 192.168.0.1 * route del route del -net 192.168.0.0/24 netmask 255.255.255.0 route del -host 192.168.0.12 gw 192.168.0.1 *route 확인 route -n

ldd3 Source

소스 위치 https://github.com/martinezjavier/ldd3 리눅스 바로 다운 #wget https://github.com/martinezjavier/ldd3/archive/master.zip #master.zip zip이 없는 경우 #apt-get install unzip # unzip  master.zip   특정위치에 풀기 #unzip master.zip -d ./ldd3 #make .. 오류 추가 vi /etc/networks snullnet0 192.168.0.0 snullnet1 192.168.1.0 #vi /etc/hosts : 192.168.0.1 local0 192.168.0.2 remote0 192.168.1.2 local1 192.168.1.1 remote1 You may need to add the  netmask 255.255.255.0  parameter if the address range chosen is not a class C range. #ifconfig sn0 local0 #ifconfig sn1 local1 #morgana% ping -c 2 remote0 커널 버전이 3.10 보다 크면  오류가 있는것 같습니다. 네트워크 드바이스 드라이버 등록 alloc_netdev network device 를 등록할때 커널의 alloc_netdev 함수를 호출하게 됩니다. 이때 장비의 이름을 eth%d 와 같은 형식으로 넘겨주게 됩니다. eth%d가 eth0, eth1등으로 reslove 되는 것은 언제일까요? 드라이버가 로딩되면 드라이버의 등록 함수(attach)에서 dev_alloc_name 함수를 이용해서 이름을 완성하게 됩니다. 따라서 디바이스 드라이버가 등록 되기전에 dev->name 을 사용하면 eth0, eth1이 아니라 eth%d 로 proc 등의 디렉토리를 만들게

모듈 유틸리티

insmod:모듈을 커널에 적재한다. rmmod:커널에서 모듈을 제거한다. lsmod:커널에서 적재된 모듈 목록을 보여준다. depmod: 모듈간 의존성 정보를 생성한다. modprobe:모듈을 커널에 적재하거나 제거한다. dmesg | grep rdma

kernel Hello World

리눅스 커널 모듈 프로그래밍 가이드 참조:http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html 커널 모듈 가이드 아래 테스트는 우분투 14.04에서 테스트 되었습니다. 모듈 유틸리티 insmod:모듈을 커널에 적재한다. rmmod:커널에서 모듈을 제거한다. lsmod:커널에서 적재된 모듈 목록을 보여준다. depmod: 모듈간 의존성 정보를 생성한다. modprobe:모듈을 커널에 적재하거나 제거한다. modinfo rdma_ucm 모듈 정보 보기: #lsmod #cat /etc/modprobe.conf #modinfo ib_core 커널에서 제공하는 심볼 테이블 :커널 내부의 함수나 변수 중 외부에서 참조할 수 있는 함수의 심볼과 주소를 담은 테이블 #cat /proc/kallsyms 커널 모듈 제작해 보기 kernel ver 3.16 hello.c /*  *  hello.c - The simplest kernel module.  */ # #include <linux/module.h> #include <linux/kernel.h> int init_module(void) { printk("<1>Hello World 1.\n"); return 0; } void cleanup_module(void) { printk(KERN_ALERT "Goodbye world 1.\n"); } Makefile obj-m += hello.o all:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean #make make -C /lib/modules/3