커널과 관련된 옵션은 /proc 디렉토리의 관련 파일을 직접 수정하거나 설정 파일인 /etc/sysctl.conf 파일을 이용하여 바꿀 수 있다. 관련 파일을 직접 수정하는 경우 재부팅하게 되면 무효가 되므로, 다음 부팅시에도 반영하려면 설정 파일인 /etc/sysctl.conf 를 수정하여 주는 방법을 사용하여야 한다.
참고로 커널관련 설정값 확인은..
# sysctl -a
-----------------------------------------------------------
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) for
# more details.
# Controls IP packet forwarding
# 마스커레이딩 사용설정 (사용 : 1, 꺼짐 : 0)
# /etc/rc.d/rc.firewall 에서 echo 1 > /proc/sys/net/ip_forward 부분과 같은 의미임
net.ipv4.ip_forward = 1
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# not response for ping
# 핑 요청에 응답 거부, 브로드캐스트 주소로 핑 을 사용하지 못하도록 함
net.ipv4.icmp_echo_ignore_all = 1
net.ipv4.icmp_echo_ignore_boradcasts = 1
# not allow SYN Attack
# SYN Attack 공격을 막기 위해서 백로그라는 큐의 크기를 늘림 (기본값은 256)
net.ipv4.tcp_max_syn_backlog = 1024
# not allow SYN Flood Attack
# SYN Flood 공격에 대응하기 위하여 설정
net.ipv4.tcp_syncookies = 1
# not allow ICMP Redirect Attack
# ICMP Redirect 를 이용한 공격을 막기 위해 리다이렉트를 끔 (기본값은 둘다 1)
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
# ignore Bad icmp
# Bad icmp 패킷을 무시 (로그가 지저분해지는 것을 막기 위함)
net.ipv4.icmp_ignore_bogus_error_responses = 1
# prevent from IP spooping and write log
# IP 스푸핑 방지 (기본값 0)
net.ipv4.conf.all.rp_filter = 1
# IP 스푸핑된 패킷을 로그에 기록함 (기본값 0)
# 콘솔에 에러 비슷한 메세지가 계속 떠서 주석처리 함
# net.ipv4.conf.all.log_martians = 1
# reduce connect time & keepalive time
# 연결 종료시간을 줄임 (기본값 60)
net.ipv4.tcp_fin_timeout = 30
# Keepalive 시간을 줄임 (기본값 7200)
net.ipv4.tcp_keepalive_time = 1800
# increase open port
# 열수 있는 로컬 포트를 늘림 (기본값은 1024 4996)
net.ipv4.ip_local_port_range = 32768 61000