Openvpn fix ip

Fórumok

Egy openvpn szervert konfiguráltam. A szerverhez három kliens kapcsolódik. Azt szeretném megoldani, hogy a kliensek mindig ugyanazt az ip-t kapják vissza a szervertől. A kliensek is linux pc-k de néha megszakad a kapcsolat és ilyenkor más ip-t kapnak.

Valaki csinált már ilyet?

Hozzászólások

a server conf fileba:
client-config-dir ccd
ccd-exclusive

ha a disztribuciodban a /etc/openvpn -ben van a config, akkor a /etc/openvpn/ccd directoryban letrehozol minden kliensnek egy filet, pontosan a kliens common name nevvel, a tartalma pedig legyen ez, ha a 10.3.2.0/24-bol osztanal ip-t:
ifconfig-push 10.3.2.1 10.3.2.2

celszeru a windows-kliens kompatibilitas miatt /30-as maszkot hasznalni, tehat
10.3.2.0 - client1 network address
10.3.2.1 - client1 ip
10.3.2.2 - client1 ptp ip
10.3.2.3 - client1 broadcast address
10.3.2.4 - client2 network address
10.3.2.5 - client2 ip

stb...

vagy egyszeruen hasznalod az erre rendszeresitett konfiguracios opciot:)

ifconfig-pool-persist ipp.txt 10

--ifconfig-pool-persist file [seconds]
Persist/unpersist ifconfig-pool data to file, at seconds intervals (de‐
fault=600), as well as on program startup and shutdown.

The goal of this option is to provide a long-term association between
clients (denoted by their common name) and the virtual IP address as‐
signed to them from the ifconfig-pool. Maintaining a long-term associa‐
tion is good for clients because it allows them to effectively use the
--persist-tun option.

nem lehet valahogy megcsinalni, hogy a kliens ip cimet (helyi)dns-be rogzitetse automatikusan kiosztaskor?

Bridzzsel futtatva, valodi dhcpvel csianlod az IP kiosztast, es az intezi? Vagy, ha tul bonyolult:

--client-connect script
Run script on client connection. The script is passed the com‐
mon name and IP address of the just-authenticated client as
environmental variables (see environmental variable section
below). The script is also passed the pathname of a freshly
created temporary file as $1 (i.e. the first command line argu‐
ment), to be used by the script to pass dynamically generated
config file directives back to OpenVPN.
If the script wants to generate a dynamic config file to be
applied on the server when the client connects, it should write
it to the file named by $1.
See the --client-config-dir option below for options which can
be legally used in a dynamically generated config file.
Note that the return value of script is significant. If script
returns a non-zero error status, it will cause the client to be
disconnected.