UNIX/Redhat

12/08/27 2장 네트워크 관리

99iberty 2012. 8. 27. 13:43



이더넷


eth0 ~

wlan0~ 무선

br0~ 브릿지

bond0 ~ 본딩 네트웍(묶음)



명령


설정파일들

기본적으로 /etc밑에.

/etc밑에는 global한 설정파일들이 위치

시스템 전체적, 공통적으로 사용하는 파일들



/root/.gconf 디렉터리 아래 system 디렉토리는 네트워크 관련 설정파일이 있는데 난 왜 없닝ㅋㅋ 설정안해논모양



cd /etc/sysconfig/network-scripts/

하면 네트워크 설정파일들 내용 볼 수 잇다.


이 디렉터리 안에 ifup-eth0 ifdown-eth0 이런건 왜 없을까?

system > preference > network connections에서

wired > edit 해서 보시면 맥주소라든지 아이피세팅 정보가 있음에도 불구하고 안보이는 이유

available to all users 해야 network-scripts 디렉토리 안에 파일이 생성이 되는데 안 그러면 사용자단위로 다르구나 해서 사용자 아래 .gconf 아래에 생기게 된다.

글로벌 파일이니까 etc는...

설정파일이 너무 많으니까 GUI로 하면 편하당......


connect automatically 하면 시스템 부팅할 때 자동적으로 해당 네트워크 카드를 써라 이런거당.ㅋ.ㅋㅋ.ㅋㅋㅋ.ㅋㅋㅋㅋ



cat /etc/sysconfic/network

 하면 뭐 networking=yes, hostname=server4.example.com, gateway=192.x.x.x 이런 내용 나온다


cat /etc/resolv.conf

 특정 dns쿼리를 하는데 호스트명의 앞부분만 주면 도메인명 줘서 알아서 서치할수잇도록...

nameserver에서는 해당 dns쿼리를 검색할 수 잇는 네임서버명을 주는거고

domain, hostname 이런 부분에서는 해당 도메인명을 뒤에다 자동으로 붙여서 검색할 수 잇도록


#dig i

#dig instructor

이렇게 해도, 원래 도메인명은 instructor.example.com 인데 저기 도메인이나 그런데에 example.com이 등록되어있으면

자동으로 붙어서 검색해준다.




ifconfig 대신에


ip addr show

써라 리눅스

보여지는 결과물에 큰 차이는 없다.

근데 왜 쓰라고 하는가?

ifconfig 는 ip alias 레이블이 없는 새 스타일로 보조 ip주소가 설정되어 있는 경우 표시되지 않으므로.


ip route

default 게이트웨이를 경유해서 나아간다.. via

default via 192.168.0.254 dev eth0  proto static

/etc/hosts를 먼저 확인하고 /etc/resolv.conf를 확인하라는데 이건 절대적이지 않다

/etc/nsswitch.conf를 보면

여기서 순서를 바꾸ㄹ 수 이ㅆㄷㅏ...?




영구적으로 뭘해라 -> 설정파일 수정하라. 파일베이스로 해야 지속적으로 유지

예제에서는 chkconfig NetworkManager off

[root@server4 etc]# chkconfig NetworkManager --list
NetworkManager     0:off    1:off    2:off    3:off    4:off    5:off    6:off


0 :runlevel

1 : 

2 : 

3 : renlevel 3에서 자동으로 실행하게다..이런..

4 : 

5 : GUI multiuser

6 :



chkconfig on 하면 정상적인 런레벨인 2,3,4,5일 때 이 데몬을 실행시키도록 하라 라는 뜨ㅅ.



Bonding Network

-mode 0 : balance-round robin

  네트워크 부하 분산 및 내결함성 향상. 디폴트


-mode 1 : Active-Backup


-mode 3 : Broadcast

  본딩된 NIC 통해서 동일한 패킷 발송. 두개의 물리적으로 다른 네트워크카드로..동일한 패킷을 내보냄.

 패킷이 절대 유실되어서는 안되는 환경에서 사용



교재랑 본딩 과정을 다르게...

ip 설정은 잘모르게ㅆ고@_@


1.우선 /etc/sysconfig/network=scripts/ifcfg-bond0

파일을 생성해서 교재와 동일하게 셋팅한다.

(대신 물리적인 네트워크카드는 2개 있어야 한다.)


2. /etc/sysconfig/network-scripts/ifcfg-eth0 , eht1 파일을 동일하게 만든다 (디바이스명만 다르게 해서.)


3. # modprobe bonding


4. # service network restart


5. # cat /proc/net/bonding/bond0



/usr/share/doc/kernel-doc-2.6.32/Documentation/networking



[root@server4 networking]# grep icmp ip-sysctl.txt
icmp_echo_ignore_all - BOOLEAN
icmp_echo_ignore_broadcasts - BOOLEAN
icmp_ratelimit - INTEGER
    icmp_ratemask (see below) to specific targets.
icmp_ratemask - INTEGER
    Bit definitions (see include/linux/icmp.h):
icmp_ignore_bogus_error_responses - BOOLEAN
icmp_errors_use_inbound_ifaddr - BOOLEAN
    If zero, icmp error messages are sent with the primary address of
    the interface that received the packet that caused the icmp error.
icmp/*:



[root@server4 networking]# grep -A5 icmp ip-sysctl.txt
icmp_echo_ignore_all - BOOLEAN
    If set non-zero, then the kernel will ignore all ICMP ECHO
    requests sent to it.
    Default: 0  <- 1로 하면 핑에 대한 응답을 처리하지 않느 걸로

icmp_echo_ignore_broadcasts - BOOLEAN
    If set non-zero, then the kernel will ignore all ICMP ECHO and
    TIMESTAMP requests sent to it via broadcast/multicast.
    Default: 1 <- 만약에 0이 아니면 브로드캐스트 핑을 무시하도록

icmp_ratelimit - INTEGER
    Limit the maximal rates for sending ICMP packets whose type matches
    icmp_ratemask (see below) to specific targets.
    0 to disable any limiting,
    otherwise the minimal space between responses in milliseconds.
    Default: 1000

icmp_ratemask - INTEGER
    Mask made of ICMP types for which rates are being limited.
    Significant bits: IHGFEDCBA9876543210
    Default mask:     0000001100000011000 (6168)

    Bit definitions (see include/linux/icmp.h):
        0 Echo Reply
        3 Destination Unreachable *
        4 Source Quench *
        5 Redirect
        8 Echo Request
--
icmp_ignore_bogus_error_responses - BOOLEAN
    Some routers violate RFC1122 by sending bogus responses to broadcast
    frames.  Such violations are normally logged via a kernel warning.
    If this is set to TRUE, the kernel will not give such warnings, which
    will avoid log file clutter.
    Default: FALSE
--
icmp_errors_use_inbound_ifaddr - BOOLEAN

    If zero, icmp error messages are sent with the primary address of
    the exiting interface.

    If non-zero, the message will be sent with the primary address of
    the interface that received the packet that caused the icmp error.
    This is the behaviour network many administrators will expect from
    a router. And it can make debugging complicated network layouts
    much easier.

    Note that if no primary address exists for the interface selected,
--
icmp/*:
ratelimit - INTEGER
    Limit the maximal rates for sending ICMPv6 packets.
    0 to disable any limiting,
    otherwise the minimal space between responses in milliseconds.
    Default: 1000





'UNIX > Redhat' 카테고리의 다른 글

12/08/28 3장 iSCSI 저장소에 액세스  (0) 2012.08.28
12/08/27 3장 저장 장치 관리  (0) 2012.08.27
12/08/27 1  (0) 2012.08.27
Yum Repository Build for RHEL  (0) 2012.08.27
Linux 학습, 기초 과정: RPM 및 YUM 패키지 관리  (0) 2012.07.26