Announcement

Collapse
No announcement yet.

สอบถามเรื่อง VPN ครับ

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • สอบถามเรื่อง VPN ครับ

    ตอนนี้เพิ่งทำ VPN ครับ ใช้ pfsense ปัญหาคือ เมื่อเชื่อม VPN ด้วย Open VPN แล้ว ไม่สามารถเข้า SAMBA ได้ ping ไม่เจอด้วยครับ OS เป็น CentOS ครับ แต่ Server เครื่องอื่นๆ เข้าใช้ได้ตามปกติครับ ใครเคยเจอปัญหานี้ รบกวนหน่อยครับ

  • #2
    up...

    Comment


    • #3
      ผมก็ไม่ได้เก่ง linux นะครับ แต่คิดว่าหน้าจะติดเรื่อง port ที่ pfsense หรือเปล่าครับ

      Comment


      • #4
        ลอง เปิดทุก port หมดแล้วก็ยังไม่ได้ครับ
        Last edited by Naklengcom; 9 Aug 2013, 10:50:39.

        Comment


        • #5
          Originally posted by Naklengcom View Post
          ลอง เปิดทุก port หมดแล้วก็ยังไม่ได้ครับ
          เครื่องที่คุณใช้ Ping ไปหา SAMBA (CentOS Server) ถ้าเป็น Windows ให้ลองปิด Firewall ก่อน ต่อจากนั้นลองทำการ Ping ไปหา SAMBA Server (CentOS Server) อีกครั้ง

          ส่วนการใช้ OpenVPN ไม่ทราบว่าคุณเปิด Ports และกำหนดกฎไฟร์วอลล์อย่างไรบ้าง อย่างเช่น ที่ Firewall >ที่แท็บ LAN, WAN, OpenVPN

          ที่ OpenVPN Server ที่ NetBIOS Options .ให้ใส่เครื่องหมายถูกที่ Enable NetBIOS over TCP/IP และ Node type เป็น h-node และ WINS Server ใส่เครื่องหมายถูกที่ Provide a WINS server list to clients
          จากนั้นใส่หมายเลขไอพีแอดเดรสของ SAMBA ลงไป

          ที่ CentOS ลองเปิดพอร์ต Ports เหล่านี้
          netbios-ns TCP port 137
          netbios-ns UDP port 137
          netbios-dgm TCP port 138
          netbios-dgm UDP port 138
          netbios-ssn TCP port 139
          netbios-ssn UDP port 139
          microsoft-ds TCP port 445
          LDAP TCP port 389

          ========================================
          Ports ที่ Samba ใช้เมื่อทำหน้าเป็น Domain Controller

          DNS 53 tcp/udp
          Kerberos 88 tcp/udp
          End Point Mapper (DCE/RPC Locator Service) 135 tcp
          NetBIOS Name Service 137 udp
          NetBIOS Datagram 138 udp
          NetBIOS Session 139 tcp
          LDAP 389 tcp/udp
          SMB over TCP 445 tcp
          Kerberos kpasswd 464 tcp/udp
          LDAPS (only if "tls enabled = yes") 636 tcp
          Dynamic RPC Ports* 1024-5000 tcp
          Global Cataloge 3268 tcp
          Global Cataloge SSL (only if "tls enabled = yes") 3269 tcp
          Multicast DNS 5353 tcp/udp
          ======================================

          ที่ RHEL/CentOS Server ลองพิมพ์คำสั่ง:

          $ grep -i NETBIOS /etc/services

          ตัวอย่าง Outputs:
          netbios-ns 137/tcp # NETBIOS Name Service
          netbios-ns 137/udp
          netbios-dgm 138/tcp # NETBIOS Datagram Service
          netbios-dgm 138/udp
          netbios-ssn 139/tcp # NETBIOS session service
          netbios-ssn 139/udp

          ต่อมาให้แก้ใขดังนี้

          สมมุติว่า Samba มีการใช้งาน 192.168.10.0/24 Subnet

          Edit /etc/sysconfig/iptables

          จากนั้นที่ RHEL/CentOS Server ให้เพิ่มบรรทัดเหล่านี้เข้าไปใหม่ก่อนบรรทัดสุดท้ายของ LOG และ ROP ให้กับ RH-Firewall-1-INPUT Chain:
          -A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -p tcp --dport 137 -j ACCEPT
          -A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -p tcp --dport 138 -j ACCEPT
          -A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -p tcp --dport 139 -j ACCEPT
          -A RH-Firewall-1-INPUT -s 192.168.10.0/24 -m state --state NEW -p tcp --dport 445 -j ACCEPT

          เสร็จแล้วทำการ Save และปิดไฟล์ดังกล่าว และให้ทำการ Restart firewall Service อีกครั้ง:
          # /sbin/services iptables restart

          ลองทดสอบตามรุปภาพดูนะผมไม่แน่ใจว่าใช่ได้หรือเปล่า


          OpenVPN Server ที่ Client Setting.jpg


          Noppy
          Last edited by Noppy; 11 Aug 2013, 06:06:39.

          Comment


          • #6
            แจ้งให้ทราบด้วย ถ้าแก้ปัญหาได้แล้ว

            Comment


            • #7
              ได้ครับผม ขอบคุณมากครับ
              Originally posted by Noppy View Post
              แจ้งให้ทราบด้วย ถ้าแก้ปัญหาได้แล้ว

              Comment


              • #8
                Originally posted by Naklengcom View Post
                ได้ครับผม ขอบคุณมากครับ
                อยากทราบว่าใช้ OpenVPN เชื่อมต่อกันแบบใหนครับ อย่างเช่น Site to Site , Multiple Site to Site หรือ Road Warrior (Laptop)Client to OpenVPN Server Site

                แก้ไขค่าคอนฟิกใหม่ดังรูป

                OpenVPN Server ที่ Client Setting2.jpg

                ทำตามนี้
                สมมุติว่า
                1. LAN ใช้ subnet 192.168.10.0/24,
                2. VPN Tunnel Subnet 172.16.16.0/24
                3. Samba Server ใช้ IP address of 192.168.10.10

                ที่ SAMBA Server

                แก้ใข Samba Configuration File (smb.conf). ให้พิมพ์ดังนี้

                hosts allow = 192.168.10.0/24 172.16.16.0/24 127.0.0.1

                แล้วทำการ Save และรีบูต SAMBA Server
                Last edited by Noppy; 12 Aug 2013, 14:18:57.

                Comment


                • #9
                  Road Warrior ครับ เดี่ยววันอังคารหรือวันพุทธ จะเข้าไปทำแล้วจะมาแจ้งผลครับ

                  Comment


                  • #10
                    Originally posted by Naklengcom View Post
                    Road Warrior ครับ เดี่ยววันอังคารหรือวันพุทธ จะเข้าไปทำแล้วจะมาแจ้งผลครับ
                    ทำตามนี้
                    สมมุติว่า
                    1. LAN ใช้ subnet 192.168.10.0/24,
                    2. VPN Tunnel Subnet 172.16.16.0/24
                    3. Samba Server ใช้ IP address of 192.168.10.10

                    ที่ SAMBA Server

                    แก้ใข Samba Configuration File (smb.conf). ให้พิมพ์ดังนี้

                    hosts allow = 192.168.10.0/24 172.16.16.0/24 127.0.0.1

                    แล้วทำการ Save และรีบูต SAMBA Server
                    Last edited by Noppy; 11 Aug 2013, 05:21:15.

                    Comment

                    Working...
                    X