Raspberry Pi + Rune Audio ::: Một trải nghiệm nghe nhạc mới

tml3nr

Moderator
Mình cài xong máy ảo rồi, giờ làm gì nữa anh. Trên trang anh để link thấy hướng dẫn cài vpn server docker gì đấy. Nó có khác mấy cái của anh không. Em làm cách 2 của anh mà chưa được loằng ngoằng quá. Non ipsec gì đấy
Em viết lại tút cài l2tp không ipsec ạ.

Bài gốc ở đây:

https://smekkley.wordpress.com/tag/l2tp-without-ipsec/

Chổ nào chưa rõ các anh cho em biết nhé.

Bước 1:

Mã:
sudo apt-get update && sudo apt-get dist-upgrade -y

sudo reboot

sudo apt-get install xl2tpd

Bước 2:

Mã:
sudo nano /etc/xl2tpd/xl2tpd.conf

Edit như sau:

Mã:
[global]
port = 1701

[lns default]
ip range = 192.168.42.10-192.168.42.250
local ip = 192.168.42.1
require chap = yes
refuse pap = yes
require authentication = yes
name = l2tpd
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes

Bước 3:

Mã:
sudo nano /etc/ppp/options.xl2tpd

Edit như sau:

Mã:
ipcp-accept-local
ipcp-accept-remote
ms-dns 8.8.8.8
ms-dns 8.8.4.4
noccp
auth
mtu 1410
mru 1410
proxyarp
connect-delay 5000

Bước 4:

Mã:
sudo nano /etc/ppp/chap-secrets

Edit như sau:

Mã:
# Secrets for authentication using CHAP
# client   server   secret           IP addresses
"vpnuser"   l2tpd   "123456"       *

Bước 5:

Mã:
sudo nano /etc/iptables/rules.v4

Remove các dòng sau:

Mã:
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

Thêm vào các dòng sau:

Mã:
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.42.0/24 -o XXXX -j MASQUERADE
-A POSTROUTING -o XXXX -j MASQUERADE
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT

Trong đoạn *filter / COMMIT thêm vào dòng sau:

Mã:
-A INPUT -p udp --sport 123 -j ACCEPT

Ghi chú:

XXXX là interface của eth0. Mình xem bằng lệnh "ip address show". Như bên dưới nó là ens3:

Mã:
ubuntu@tml3nr-e2:~$ ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet 10.0.0.123/24 brd 10.0.0.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
15: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN group default qlen 3
    link/ppp
    inet 192.168.42.1 peer 192.168.42.11/32 scope global ppp0
       valid_lft forever preferred_lft forever

Sau đó chạy lệnh:

Mã:
sudo iptables-restore < /etc/iptables/rules.v4

Bước 6:

Mã:
sudo nano /etc/sysctl.conf

Thêm vào:

Mã:
net.ipv4.ip_forward=1

Sau đó:

Mã:
sudo sysctl -p

Bước 7:

Mã:
sudo systemctl restart xl2tpd

Vậy là xong rồi ạ. Mình đã có 1 cái VPN không ipsec.

User là vpnuser

Password là 123456.
 
Chỉnh sửa lần cuối:

linh0983

Well-Known Member
http://www.audio-linux.com/
AL support cái này các bác a . :D

BVcf.jpg


https://www.diretta.link/
https://www.fshare.vn/file/WUBQHY4C36AL
Vẫn pass cũ a . :p
File này nguyên gốc mình chưa updata gì cả để up cho nhanh ko rớt giữa chừng các bác up qua http://192.168.x.y:8500 a . :oops:
 

toi511

Well-Known Member
Em viết lại tút cài l2tp không ipsec ạ.

Bài gốc ở đây:

https://smekkley.wordpress.com/tag/l2tp-without-ipsec/

Chổ nào chưa rõ các anh cho em biết nhé.

Bước 1:

Mã:
sudo apt-get update && sudo apt-get dist-upgrade -y

sudo reboot

sudo apt-get install xl2tpd

Bước 2:

Mã:
sudo nano /etc/xl2tpd/xl2tpd.conf

Edit như sau:

Mã:
[global]
port = 1701

[lns default]
ip range = 192.168.42.10-192.168.42.250
local ip = 192.168.42.1
require chap = yes
refuse pap = yes
require authentication = yes
name = l2tpd
pppoptfile = /etc/ppp/options.xl2tpd
length bit = yes

Bước 3:

Mã:
sudo nano /etc/ppp/options.xl2tpd

Edit như sau:

Mã:
+mschap-v2
ipcp-accept-local
ipcp-accept-remote
noccp
auth
mtu 1280
mru 1280
proxyarp
lcp-echo-failure 4
lcp-echo-interval 30
connect-delay 5000
ms-dns 8.8.8.8
ms-dns 8.8.4.4

Bước 4:

Mã:
sudo nano /etc/ppp/chap-secrets

Edit như sau:

Mã:
# Secrets for authentication using CHAP
# client   server   secret           IP addresses
"vpnuser"   l2tpd   "123456"       *

Bước 5:

Mã:
sudo nano /etc/iptables/rules.v4

Remove các dòng sau:

Mã:
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited

Thêm vào các dòng sau:

Mã:
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.42.0/24 -o XXXX -j MASQUERADE
-A POSTROUTING -o XXXX -j MASQUERADE
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT

Ghi chú:

XXXX là interface của eth0. Mình xem bằng lệnh "ip address show". Như bên dưới nó là ens3:

Mã:
ubuntu@tml3nr-e2:~$ ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
    link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet 10.0.0.123/24 brd 10.0.0.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxx:xxxx:xxxx/64 scope link
       valid_lft forever preferred_lft forever
15: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN group default qlen 3
    link/ppp
    inet 192.168.42.1 peer 192.168.42.11/32 scope global ppp0
       valid_lft forever preferred_lft forever

Sau đó chạy lệnh:

Mã:
sudo iptables-restore < /etc/iptables/rules.v4

Bước 6:

Mã:
sudo nano /etc/sysctl.conf

Thêm vào:

Mã:
net.ipv4.ip_forward=1

Sau đó:

Mã:
sudo sysctl -p

Bước 7:

Mã:
sudo systemctl restart xl2tpd

Vậy là xong rồi ạ. Mình đã có 1 cái VPN không ipsec.

User là vpnuser

Password là 123456.
Xxx có hai cái nhập cái nào anh. Cảm ơn anh
 

tml3nr

Moderator
chờ tút của bác cho non ipsec

Xxx có hai cái nhập cái nào anh. Cảm ơn anh
Em mới cập nhật thêm một việc ở Bước 5 ạ. Các anh chịu khó xem lại bài trên nhé.

Các anh tham khảo file /etc/iptables/rules.v4 của em:

Mã:
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
# iptables configuration for Oracle Cloud Infrastructure

# See the Oracle-Provided Images section in the Oracle Cloud Infrastructure
# documentation for security impact of modifying or removing these rule

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:InstanceServices - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp --sport 123 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A OUTPUT -d 169.254.0.0/16 -j InstanceServices
-A InstanceServices -d 169.254.0.2/32 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.2.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.4.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.5.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.2/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 53 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p tcp -m tcp --dport 53 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.3/32 -p tcp -m owner --uid-owner 0 -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.4/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 67 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 69 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp --dport 123 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.0/16 -p tcp -m tcp -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j REJECT --reject-with tcp-reset
-A InstanceServices -d 169.254.0.0/16 -p udp -m udp -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j REJECT --reject-with icmp-port-unreachable
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.42.0/24 -o ens3 -j MASQUERADE
-A POSTROUTING -o ens3 -j MASQUERADE
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
 
Chỉnh sửa lần cuối:

hai3009

New Member

toi511

Well-Known Member
Em mới cập nhật thêm một việc ở Bước 5 ạ. Các anh chịu khó xem lại bài trên nhé.

Các anh tham khảo file /etc/iptables/rules.v4 của em:

Mã:
# CLOUD_IMG: This file was created/modified by the Cloud Image build process
# iptables configuration for Oracle Cloud Infrastructure

# See the Oracle-Provided Images section in the Oracle Cloud Infrastructure
# documentation for security impact of modifying or removing these rule

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:InstanceServices - [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp --sport 123 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A OUTPUT -d 169.254.0.0/16 -j InstanceServices
-A InstanceServices -d 169.254.0.2/32 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.2.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.4.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.5.0/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.2/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 53 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p tcp -m tcp --dport 53 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.3/32 -p tcp -m owner --uid-owner 0 -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.4/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 67 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp -m udp --dport 69 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.169.254/32 -p udp --dport 123 -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j ACCEPT
-A InstanceServices -d 169.254.0.0/16 -p tcp -m tcp -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j REJECT --reject-with tcp-reset
-A InstanceServices -d 169.254.0.0/16 -p udp -m udp -m comment --comment "See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule" -j REJECT --reject-with icmp-port-unreachable
COMMIT
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -s 192.168.42.0/24 -o ens3 -j MASQUERADE
-A POSTROUTING -o ens3 -j MASQUERADE
-A POSTROUTING -o ppp0 -j MASQUERADE
COMMIT
Xong hết mình add vô router như nào anh nhỉ. add địa chỉ nào vào. mấy vụ này em không rành. cảm ơn anh
 

nqn_vnn

Well-Known Member
E có acc visa bên ACB mà sao tao
Đã từ lâu em tò mò về Oracle VPS. Không biết nó ra sao.

May mắn gần đây được các anh bên voz dẫn đường. Em mò mò xáp vô dùng thử.

Hay cực kỳ các anh ạ. Tiếc là giờ em mới biết tới cái này :eek:

Trước mắt em dùng nó làm VPN để có IP US, nghe nhạc và down app linh tinh.

Về mảng nhạc em nghĩ mình cũng có thể dùng nó làm được nhiều thứ hay ho khác.

Sau khi đăng ký (Free, chỉ cần có thẻ Master hoặc Visa). Mình sẽ có được 6 con máy ảo (VM). Mỗi con có IP public riêng:

1-vps-cloud.png

Em chọn OS là Ubuntu. Nhờ vật lộn với pi một thời gian nên xáp vô thấy quen quen. 2 lệnh speedtest bên dưới là em test tốc độ download từ server US và server VN về con vm đang nằm ở US - San Jose:

2-vm-a1.png

Bước đầu tiên em setup IPSec/L2TP server để có VPN xài. May là script có sẵn nên em chỉ cần chạy một dòng lệnh duy nhất là xong:

https://github.com/hwdsl2/setup-ipsec-vpn/

Sau khi setup xong VPN server. Mình có thể setup nó lên router, PC hoặc IOS, Android để dùng.

Setup trên router:

3-vpn-router.png

Setup trên PC:

4-vpn-pc.png

Setup lên IOS:

5-vpn-iphone.png

Em theo tút của LibreSpeed. Set cho con vm làm một server speedtest luôn. Cũng vui vui:

6-speedtest-vn-2-cloud.png

Em mới mò vô mảng VPS này nên còn nhiều cái chưa biết. Nhưng trước mắt thấy rất hay và có thể áp dụng vào music server. Mời các anh cùng tham gia cho vui ạ.

Lưu ý: Nên suy nghĩ thật kỹ trước khi chọn Region. Vì sau đó không đổi được.

Vài link tham khảo cho người mới:

https://www.oracle.com/cloud/free/

https://thuanbui.me/thiet-lap-vps-mien-phi-oracle-cloud/

https://cloudyez.com/tao-oracle-cloud-de-sudung-server-mien-phi/

https://voz.vn/t/cai-dat-adguard-home-chan-quang-cao-tren-vps.178061/
Tạo mãi không qua được bước điền Visa ( ACB ) ... Rõ chán luôn Bác à :(

"We're unable to complete your sign up. Common sign up errors are due to: (a) Using prepaid cards. Oracle only accepts credit card and debit cards (b) Intentionally or unintentionally masking one's location or identity (c) Entering incomplete or inaccurate account details. Please try again if this applies to you. Otherwise, contact"
 

binna

Well-Known Member
E có acc visa bên ACB mà sao tao

Tạo mãi không qua được bước điền Visa ( ACB ) ... Rõ chán luôn Bác à :(

"We're unable to complete your sign up. Common sign up errors are due to: (a) Using prepaid cards. Oracle only accepts credit card and debit cards (b) Intentionally or unintentionally masking one's location or identity (c) Entering incomplete or inaccurate account details. Please try again if this applies to you. Otherwise, contact"
em cũng visa ACB nè bác, đăng ký phát ăn ngay, mới đầu họ trừ 1 $ Sing, sau đó hoàn lại
 

linh0983

Well-Known Member
E có acc visa bên ACB mà sao tao

Tạo mãi không qua được bước điền Visa ( ACB ) ... Rõ chán luôn Bác à :(

"We're unable to complete your sign up. Common sign up errors are due to: (a) Using prepaid cards. Oracle only accepts credit card and debit cards (b) Intentionally or unintentionally masking one's location or identity (c) Entering incomplete or inaccurate account details. Please try again if this applies to you. Otherwise, contact"
Xong rồi a . :mad:
 

tml3nr

Moderator
E có acc visa bên ACB mà sao tao

Tạo mãi không qua được bước điền Visa ( ACB ) ... Rõ chán luôn Bác à :(

"We're unable to complete your sign up. Common sign up errors are due to: (a) Using prepaid cards. Oracle only accepts credit card and debit cards (b) Intentionally or unintentionally masking one's location or identity (c) Entering incomplete or inaccurate account details. Please try again if this applies to you. Otherwise, contact"
Anh thử các bước sau ạ. Em reg bằng mastercard debit của Ếch Xiêm Bank được liền.

- Clear hết cookie của browser.
- Dùng PC khác để reg.
- Dùng thẻ khác o_O
 
Bên trên