[완료]ipvsadm direct routing방식으로 사용했을 시 패킷이 돌아오질 않습니다.

visualplus의 이미지

 
          인터넷
             |
             | eth1:xxx.xxx.xxx.xxx
             /------
             | lvs |
             -------
                 | eth0:172.16.107.1
         <------------------->
             | eth1:172.16.107.11
             | lo0:xxx.xxx.xxx.xxx (lvs eth1 ip)
        /--------------
        | real server |
        ---------------

linux debian sarge 2.6.16.7
ipvsadm 1.24
vsftpd (port 90)

-- realserver
- all
arp_announce = 2
arp_ignore = 1

- lo
arp_announce = 2
arp_ignore = 1

이렇게 구축해놨는데 lvs:90으로 ftp접속을 하면 real server:90까지 잘 오고
real server:90에서 사용자에게 패킷을 보냅니다.
그런데 lvs에서 사용자에게 가는 패킷을 다시 인터넷쪽으로 보내질 못하네요.

근데 이상한것은 ipaudit로 eth0를 잡아보면 realserver에서 사용자에게 가는 패킷이 안잡힙니다.
그런데 tcpdump로 잡으면 realserver에서 사용자에게 가는 패킷이 잡히네요.

ipaudit promisc 옵션을 넣어도 그렇고 안넣어도 그렇습니다.

그런데 iptables의 PREROUTING의 mangle, nat 까진 잘 오는것 같은데,
forward 의 mangle까지 안오는것 같습니다.
출발지가 lvs ip니 혹시 output으로 나갈까 생각도 해봤지만
output filter에서도 잡히질 않습니다.

iptables가 적용 되는것을 봐서는 패킷이 들어오긴 한 것 같은데..
왜 다시 eth1로 나가질 못하는것일까요?

visualplus의 이미지

제 질문엔 대체로 답변이 없네요..ㅠㅠ
제가 제대로 설명을 못하고 있는건지.. 잘 모르겠지만..
혹시나 이런 문제를 갖고있는 분이 또 계실지 몰라서.. 자답올립니다ㅎ

제가 구축한 방식에서는 lvs의 ip가 eth0에서 forward로 오기때문에 문제가 생긴것 같습니다.
(영어 문서를 봐서 정확한 원인은 모르겠지만.. invalid라고 설명을 해논것 같더군요..)

그래서 forward_shared 패치를 해줘야 합니다.
패치를 하고나서
/proc/sys/net/ipv4/conf/eht1 (wan nic)
/proc/sys/net/ipv4/conf/eht0 (lan nic)

이 두개에 echo 1 > 을 해 주면 정상적인 통신이 됩니다.

결론은. 비정상적인 패킷이기때문에 리눅스 커널에서 차단한것 같네요.

http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/index.html
이 문서 어디엔가 있었는데.. 북마크를 안해둬서 어디있었는진 잘 모르겠네요..ㅎㅎ

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.