°Ô½Ã¹° 260°Ç
   
[redhat6.7] gateway Ãß°¡ - ¶ó¿ìÆà Ãß°¡¹æ¹ý
±Û¾´ÀÌ : theko ³¯Â¥ : 2016-07-29 (±Ý) 15:27 Á¶È¸ : 6221
Linux¿¡¼­ Gateway¸¦ Ãß°¡ ÇÏ´Â ¹æ¹ýÀº ´ÙÀ½°ú °°´Ù. 

1. Gateway¸¦ Ãß°¡ÇÏ°í ½ÍÀº eth Ä«µå¿¡ Gateway Ãß°¡ (/etc/sysconfig/network-scrpit/if-eth* ÆÄÀÏ¿¡ Gateway Ãß°¡)
    ex) GATEWAY=10.1.1.1

2. Route table¿¡ Gateway Ãß°¡
    ex) route add -net 10.1.1.0/24 gw 10.1.1.1 eth2

3. iproute¸¦ ÀÌ¿ëÇÏ¿© rule ¹× route º¯°æ (/etc/iproute2/rt_tables)
     ex) echo 200 eth2 >> /etc/iproute2/rt_tables
          ip rule add fwmark 1 table eth2
          ip route add default via 10.1.1.1 table eth2 

4. iptables ¸¦ ÀÌ¿ëÇÏ¿© ÆÐŶ¿¡ Ç¥½ÄÀ» ´Þ¾ÆÁÜ
   À§¿¡ ip rule ¼³Á¤¿¡ º¸¸é fwmark 1 À̶ó°í µÇ¾î ÀÖ´Â ºÎºÐÀÌ µ¿ÀÛ ÇÏ´Â ºÎºÐ ÀÓ
   ex) iptables -A OUTPUT -t mangle -s 10.1.1.2 -j MARK --set-mark 1

* rc.d/rd.local¿¡ ÀÚµ¿ ½ÇÇà Ãß°¡¸¦ ÇØÁÖ¸é ¸®ºÎÆýà ÀÚµ¿À¸·Î ½ÇÇà µÊ
* ¿¹¹®Àº Gateway¸¦ Ãß°¡ÇÏ°í ½ÍÀº eth Ä«µå°¡ eth2 ÀÌ°í IP°¡ 10.1.1.2ÀÏ °æ¿ì ÀÓ




 cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=media
GATEWAY=192.168.0.16
GATEWAYDEV=eth0                     <--µðÆúÆ® °ÔÀÌÆ®¿þÀÌ·Î ³ª°¡´Â ³×Æ®¿öÅ© Ä«µå°¡  eth0 À¸·Î ¼³Á¤



Ãâó : http://egloos.zum.com/jove01/v/4884216
http://blog.daum.net/_blog/BlogTypeView.do?blogid=0ONoe&articleno=11

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com