@@ -55,6 +55,35 @@ run itself. `$VOPONO_NS_IP` is useful if you'd like to configure a server
55
55
running within the network namespace to listen on its local IP address only
56
56
(see below, for more information on that).
57
57
58
+ The application to run within the namespace also has access to
59
+ ` $VOPONO_HOST_IP ` , to get the IP address of the host.
60
+
61
+ Note: These environment variables are currently only available from within
62
+ the application/script to run, not on the command line. So the following
63
+ doesn't work:
64
+
65
+ ` vopono exec {other Vopono options} 'echo "HOST IP: $VOPONO_HOST_IP"' `
66
+
67
+ Output: ` HOST IP: $VOPONO_HOST_IP ` (the environ variable wasn't expanded).
68
+
69
+ A work around is to create a executable script, that executes the
70
+ application you'd like to run:
71
+
72
+ ``` bash
73
+ #! /bin/bash
74
+
75
+ echo " => NETWORK NAMESPACE IP: $VOPONO_NS_IP "
76
+ echo " => HOST IP: $VOPONO_HOST_IP "
77
+ ```
78
+
79
+ Execution: ` vopono exec {other Vopono options} '/path/to/the/above/script.sh' `
80
+
81
+ Output:
82
+
83
+ ```
84
+ => NETWORK NAMESPACE IP: 10.200.1.2
85
+ => HOST IP: 10.200.1.1
86
+ ```
58
87
59
88
### Host scripts
60
89
@@ -65,6 +94,15 @@ Note these scripts run on the host (outside the network namespace), using the cu
65
94
and with the same user as the final application itself (which can be set
66
95
with the ` user ` argument or config file entry).
67
96
97
+ Script arguments (e.g. ` script.sh arg1 arg1 ` ), are currently not possible, resulting in an error:
98
+
99
+ ```
100
+ $ vopono exec {other Vopono options} --postup 'echo POSTUP' ls
101
+ [...]
102
+ sudo: echo POSTUP: command not found
103
+ [...]
104
+ ```
105
+
68
106
### Wireguard
69
107
70
108
Install vopono and use ` vopono sync ` to
0 commit comments