안녕하세요. 제 리눅스에 랜카드가 2개 있는데요

eth0는 192.168.10.0/24 네트워크이고
eth1은 192.168.1.0/24 네트워크에 연결되어 있습니다.

외부로 나가는 패킷을 eth0를 통해서 나가도록 설정하고 싶은데

아래처럼 default gateway가 eth1로 설정되어서 eth1로 나가고 있습니다.

[root@fujitsu ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1

그래서 아래처럼 명령을 내렸습니다.



$ route add default gw 192.168.10.1 eth0

결과는 아래와 같습니다.

[root@fujitsu ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth1
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
link-local * 255.255.0.0 U 1003 0 0 eth1
default 192.168.10.1 0.0.0.0 UG 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth1

이렇게 했는데.. 여전히 외부로 나가는 패킷이 eth1(192.168.1.1)을 통해 전송됩니다.

eth0를 통해서 외부로 나가도록 할수는 없을까요?

감사합니다.

 



참조 : http://sinun.tistory.com/25

default 라우팅

default 라우팅 원래있던걸 지워주세요

언제나 삽질 - [url=http://http://tisphie.net/typo/]http://tisphie.net/typo/[/url]
프로그래밍 언어 개발 - http://langdev.net[/url]

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

또는 gateway eth0의

또는 gateway eth0의 metric을 높여 버리시면 eth1이 우선이 됩니다.

답변감사합니다.

=====================

두분 답변 감사합니다. ^^

메트릭값을 높여서 처리할 수도 있겠지만

default gw는 한개만 있는게 정상일것 같은 생각이 드네요.

IP 받아올때 default gw를 모두 지워버린 후
다시 설정하는 식으로 변경하는게 좋을 것 같습니다.

dhclient 로 동적으로 IP를 받아오는 건데...
ps 해보니깐 아래처럼 나오네요

$ ps -ef 
.... 생략
/sbin/dhclient -d -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth1.pid -lf /var/lib/dhclient/dhclient-eth1.lease -cf /var/run/nm-dhclient-eth1.conf eth1
.... 생략

IP를 받아온 후에 실행되는 스크립트가 /usr/libexec/nm-dhcp-client.action 이네요
근데 스크립트 파일이 아니라.. 바이너리파일이네요

죄송합니다만.. dhclient 실행 옵션은 어디서 조정하는지.. 알 수 있을까요?

nm-dhcp-client.action이 무슨일을 하는지도 모르겠구..에휴

=====================

dhclient.conf 에서

dhclient.conf 에서 조정할 수 있습니다. eth1쪽에 router정보를 요청하지 않으면 되겠네요.

man dhclient.conf 참조.

언제나 삽질 - [url=http://http://tisphie.net/typo/]http://tisphie.net/typo/[/url]
프로그래밍 언어 개발 - http://langdev.net[/url]

언제나 삽질 - http://tisphie.net/typo/
프로그래밍 언어 개발 - http://langdev.net

답변 감사합니다.

=====================

답변감사합니다.
좋은 하루 되세요

=====================

 

출처 :https://kldp.org/node/118511


cat /proc/cpuinfo 명령어로 확인 할 수 있다

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6420  @ 2.13GHz
stepping        : 6
cpu MHz         : 2127.968
cache size      : 64 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est tm2 xtpr
bogomips        : 4227.07

여기서 lm 이 나오면 64bit => long mode
rm 이 나오면 32bit => Real Mode
pm이 나오면 32bit => Product Mode
=============================================================
리눅스 커널의 32bit,64bit 확인법
uname -a 명령어 결과
64 나 ix86 이 나올 경우 64bit 임
=============================================================
cpu 32 bit 인지 64 bit 인지 확인법
file /sbin/init 명령어 결과
/sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped
또는
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped





'Linux' 카테고리의 다른 글

crontab 설정확인 및 로그 확인  (0) 2015.06.16
리눅스에 랜카드 2개일때, default gateway 설정  (0) 2015.06.16
linux iptables 적용방법  (0) 2015.06.16
리눅스 프로세스 종료 방법  (0) 2015.06.16
linux iptables start, stop  (0) 2015.06.14

#vi /etc/sysconfig/iptables  ->수정후

#iptables-restore < /etc/sysconfig/iptables  

# service iptables restart 


해야 적용이 된다.





1. 일반 프로세스

 

안녕하세요, 이번 강좌에서는 리눅스에서 프로세스를 종료하는 방법을 알아보겠습니다.

 

일반적으로 프로세스를 종료할 때는 kill 명령을 이용하는데 아래와 같은 형식으로 사용합니다. PID는 프로세스 고유 ID(숫자)를 말합니다.

 

 

[root@localhost ~]# kill PID

 


 

그런데, PID를 알아내려면 어떻게 해야 할까요? 가장 쉬운 방법은 프로세스 리스트에서 해당 프로세스의 PID를 확인하는 것입니다.

프로세스 리스트를 보려면 ps 명령을 이용하고 리스트가 너무 기니 grep 명령을 이용하여 필요한 라인을 찾습니다.

 

 

[root@localhost ~]# ps -A |grep processname

 

 

그러면 왼쪽에서 PID를 확인할 수 있습니다.

 

 

2. 데몬

 

데몬의 경우를 나눈 이유는 스레드가 여러개여서 그런데, 위 명령대로 확인해 보면 많으면 10개까지 프로세스가 떠있는 경우가 있습니다.

그래서 이런 경우는 일일이 종료할 필요가 없는데, 데몬을 종료하는 방법은 3가지가 있습니다.

 

먼저, 가장 일반적이고 정상적인 방법입니다.

 

 

[root@localhost ~]# service daemonname stop

 

 

강제로 종료하려면 killall 명령을 이용하면 됩니다.

 

 

[root@localhost ~]# killall daemonname

 

 


 

또, 마지막으로 모든 데몬이 지원하는 건 아니지만,

 

 

[root@localhost ~]# cat /var/run/daemonname.pid

[root@localhost ~]# kill PID

 

를 입력하시면 됩니다.

/var/run 디렉토리에는 실행중인 메인 데몬의 PID가 있습니다. 그래서 첫번째 줄을 실행하면 메인 PID가 나옵니다.


출처 : http://kjvvv.kr/14174

리눅스에서 프로세스 종료하기 - 리눅스 포럼
1. 일반 프로세스 안녕하세요, 이번 강좌에서는 리눅스에서 프로세스를 종료하는 방법을 알아보겠습니다. 일반적으로 프로세스를 종료할 때...
kjvvv.kr
본문으로 이동
 


'Linux' 카테고리의 다른 글

리눅스 CPU (32bit,64bit 확인 법)  (0) 2015.06.16
linux iptables 적용방법  (0) 2015.06.16
linux iptables start, stop  (0) 2015.06.14
리눅스 CPU (32bit,64bit 확인 법)  (0) 2015.06.14
CentOS 6.4 Minimal 설치  (0) 2014.03.11

시작 

/etc/init.d/iptables start

스톱

/etc/init.d/iptables stop



*두번째

service iptables stop

service iptables start


*ipchains 을 중지한다.

service ipchains stop


*서버 재시작시 시작되지 않게.

chkconfig ipchains off

chkconfig iptables off


출처 : http://blog.naver.com/sizin/220375848289





cat /proc/cpuinfo 명령어로 확인 가능

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Core(TM)2 CPU          6420  @ 2.13GHz
stepping        : 6
cpu MHz         : 2127.968
cache size      : 64 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 10
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl est tm2 xtpr
bogomips        : 4227.07



여기서 lm 이 나오면 64bit => long mode
rm 이 나오면 32bit => Real Mode
pm이 나오면 32bit => Product Mode
=============================================================
리눅스 커널의 32bit,64bit 확인법
uname -a 명령어 결과
64 나 ix86 이 나올 경우 64bit 임
=============================================================
cpu 32 bit 인지 64 bit 인지 확인법
file /sbin/init 명령어 결과
/sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped
또는
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped




CentOS 6.4 Minimal 설치

1. 업데이트 및 주요 유틸리티 설치

[root@localhost ~] # yum -y update
[root@localhost ~] # yum -y install ntsysv system-config-network-tui setuptool bind-utils unzip wget rdate rsync crontabs make gcc gcc-c++ patch autoconf parted sudo

[root@localhost ~] #

2. Selinux & 방화벽 비활성화



[root@localhost ~] # vi /etc/selinux/config
~
SELINUX=disabled
~

[root@localhost ~] # iptables -F
[root@localhost ~] # /etc/init.d/iptables save

[root@localhost ~] #

3. APM(Apache, PHP, Mysql) 설치

[root@localhost ~] # yum -y install httpd php mysql mysql-server php-mysql

[root@localhost ~] #

4. 라이브러리 설치

[root@localhost ~] # yum -y install zlib zlib-devel freetype freetype-devel freetype-utils gd gd-devel libjpeg libjpeg-devel libpng libpng-devel php-gd php-xml php-mbstring

5. 서비스 시작

 

 

 


[root@localhost ~] # service httpd restart; service mysqld restart

6. RHEL Repository 추가

 

[root@localhost ~] # cd /usr/src
[root@localhost src] #
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@localhost src] # wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
[root@localhost src] # rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
[root@localhost src] # ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo

7. php-mcrypt 외 설치

[root@localhost ~] # yum -y install libmcrypt libmcrypt-devel php-mcrypt

[root@localhost ~] #

참조 : http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x

8. ntsysv 설정

출처 : http://marin577.dothome.co.kr/wordpress/?p=55

 


[존더리퍼] John the Ripper를 이용하여 패스워드 크랙하기

0x01 보안 2010/01/04 18:11
[존더리퍼] John the Ripper를 이용하여 패스워드 크랙하기


john-1.7.4.tar.tar



리눅스 머신에서 John the Ripper를 이용하여 Brute Forcing(Dictionary Scan)을 통해,
간단한 비밀번호의 경우 크랙이 가능합니다.

방법)




1. http://www.openwall.com/john/ 에서 JTR을 다운 받습니다.

2. 다운 받은 john-1.7.4.tar.tar 파일을 리눅스 머신에 업로드 합니다.

3. tar xvfz john-1.7.4.tar.tar 하여 압축을 풉니다.

4. cd /john-1.7.4/src // src 경로로 이동합니다.

5. make linux-x86-any // 컴파일 합니다.

6. cd ../run/ // run 경로로 이동합니다.

7. ./unshadow /etc/passwd /etc/shadow > userlist.txt // passwd 파일과 shadow 파일을 합칩니다.


8. ./john userlist.txt // 크랙을 시도합니다.



# 크랙된 내용을 보는 명령어는
./john --show userlist.txt




'Linux' 카테고리의 다른 글

linux iptables 적용방법  (0) 2015.06.16
리눅스 프로세스 종료 방법  (0) 2015.06.16
linux iptables start, stop  (0) 2015.06.14
리눅스 CPU (32bit,64bit 확인 법)  (0) 2015.06.14
CentOS 6.4 Minimal 설치  (0) 2014.03.11

+ Recent posts