설치

OpenVPN Tap Bridge - Ubuntu

T8.CO.KR 2026. 9. 24. 16:33

클라이언트가 서버 측 Lan에 가담하게 한다.
*서버와 클라이언트 hostname을 server, client 네트워크 어댑터를 enp0s3이라고 가정한다.
static.key는 서버에서 만들고 클라이언트에게 복사한다.


-. 서버
sudo apt install openvpn bridge-utils
openvpn --genkey --secret /etc/openvpn/static.key


cat > /etc/openvpn/server.conf << EOF
dev tap0
dev-type tap
proto udp
lport 1194
daemon
auth SHA256
cipher AES-256-CBC
up server.sh
script-security 3
secret static.key
ping-timer-rem
keepalive 10 60
persist-tun
persist-key
log /var/log/openvpn/openvpn.log
status /var/log/openvpn/status.log
verb 3
EOF

cat > /etc/openvpn/server.sh << EOF
#!/bin/bash
ip link add br0 type bridge
ip link set tap0 master br0
ip link set enp0s3 master br0
ip link set br0 up
ip link set tap0 up
EOF

sudo chmod a+x /etc/openvpn/server.sh
sudo systemctl enable openvpn@server --now
sudo ufw allow 1194/udp
cat /var/log/openvpn/status.log
ip addr show tap0

-. 클라이언트
sudo apt install openvpn bridge-utils


cat > /etc/openvpn/client.conf << EOF
dev tap0
remote 서버주소 1194 udp
auth SHA256
cipher AES-256-CBC
up client.sh
script-security 3
secret static.key
persist-tun
persist-key
log /var/log/openvpn/openvpn.log
status /var/log/openvpn/status.log
EOF


cat > /etc/openvpn/client.sh << EOF
#!/bin/bash
ip link add br0 type bridge
ip link set tap0 master br0
ip link set enp0s3 master br0
ip link set br0 up
ip link set tap0 up
ip link set enp0s3 up
EOF

sudo chmod a+x /etc/openvpn/client.sh
sudo systemctl enable openvpn@client --now
cat /var/log/openvpn/status.log
ip addr show tap0

'설치' 카테고리의 다른 글

nginx 설치 - Windows  (0) 2026.09.25
MaaS 설치 - Ubuntu  (0) 2026.09.25
CentOS 7 - Oracle SE 19c 설치  (0) 2026.09.23
CentOS 7 - Tomcat 9 설치  (0) 2026.09.23
CentOS 7 - JDK8 설치  (0) 2026.09.23