
Ubuntu 18.04 시스템에서 실행 중인 OpenVPN 서버가 있고 이더넷 브리징(계층 2)을 통해 Ubuntu 20.04 시스템을 사용하여 서버에 연결하고 싶습니다.
OpenVPN을 성공적으로 생성했지만 연결할 수 없는 것 같습니다.
내 클라이언트 측의 tap0이 IP를 수신하지 않습니다.
나는 또한 네트워킹 등에 대해 새로운 지식을 갖고 있다고 말하고 싶습니다.
내 최종 목표는 서버와 클라이언트 모두에 대해 고정 IP 주소를 갖는 것입니다. DHCP를 사용하고 싶지 않습니다.
내 구성은 다음과 같습니다.
Server.conf
port 1194
proto udp
dev tap0
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
up "/etc/openvpn/up.sh br0 tap0 1500"
down "/etc/openvpn/down.sh br0 tap0"
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface. Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0. Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients. Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses. You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
server-bridge
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1
클라이언트.ovpn
client
dev tap
proto udp
remote hidden 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
remote-cert-tls server
key-direction 1
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
cipher AES-256-CBC
verb 4
답변1
바로 업데이트를 못해서 죄송합니다. 나는 실제로 이 작업을 완료했습니다. 클라이언트를 서버에 성공적으로 연결했습니다. 둘 다 일반 LAN처럼 연결되며 두 PC에 연결된 다른 보드에도 연결할 수 있습니다. 내 질문을 확인해 주신 모든 분들께 감사드립니다.
내 솔루션:
서버와 클라이언트 모두에 대한 모든 구성을 동일하게 유지했습니다. 내가 해야 할 일은 내 CLIENT 측의 tap0 인터페이스에 IP를 할당하는 것뿐이었습니다(그리고 'sudo ip link set up tap0'을 잊지 마세요). 그런 다음 tap0 인터페이스는 클라이언트에서 서버로 또는 그 반대로 서로 통신할 수 있습니다.
참고: 서버가 클라이언트 측 보드 중 하나와 통신할 수 있기를 원하므로 물리적 인터페이스와 탭 인터페이스를 브리지에 연결했습니다. 그런 다음 물리적 인터페이스에 있던 IP를 브리지에 할당합니다. 클라이언트에 할당된 IP가 서버와 동일한 서브넷에 있는지 확인하세요. 예: 192.168.x.25 및 192.168.x.26.
이 설정을 통해 두 PC가 서로 통신할 수 있었고 심지어 PC에 연결된 보드도 통신할 수 있었습니다.
다시 한번, 도움주신 모든 분들께 감사드립니다!