openvpn trouble with dhcp
by ricky_cardo from LinuxQuestions.org on (#59K4D)
Slackware64-current close to vanilla, full install, (additional-sbopkg fail2ban, librsync, rdiff-backup)
I'm having a interesting issue like this one:
https://bugs.launchpad.net/ubuntu/+s...n/+bug/1598522
Symptom is: When I start openvpn I loose connectivity to all hosts on my lan, and when rebooting Often times I don't get an IP assigned to the interface (eth0) and need to run dhcpcd eth0
Note: Similar in symptom only (no systemd etc)
I should add for my network configuration I am using /etc/rc.d/rc.inet1.conf
- using this:
Code:# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
IPALIASES[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""- Then as usual /etc/rc.d/rc.inet2 (starts openvpn because I have rc.openvpn exectable)
What I noticed is eth0 does not get an IP fast enough, (if I set the address static, I'm fine, but if I allow dhcpcd to negotiate for address it seems to consistently not get an address before openvpn tries to bind and disrupts the process)
Still in the testing Phase.
(couple ideas are add /usr/bin/sleep 10 to /etc/rc.d/rc.inet2 --seems poor idea don't like messing here)
could mark it non-executable then add something in rc.local to do it (maybe with a 10 second sleep before it)
-- I'll investigate further... (wondering if anyone else experiences)
***After a bit more testing it seems my real problem is using dhcpd and openvpn.
I had been using dhcp yes (with a static-ip set in the router, by mac)
After I set the static address in inet1.conf all issue evaporated (went away).
so changed to static via inet1.conf
Code:# Config information for eth0:
IPADDR[0]="192.168.157.203"
NETMASK[0]="255.255.255.0"
IPALIASES[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Default gateway IP address:
GATEWAY="192.168.157.1"
Two questions:
1. I really would like to leave this interface with dhcp. (Plan to turn this into a Slackware home router ((has 2 interfaces only currently using 1))) Am I missing something to use dhcpcd and openvpn? (when I start openvpn I loose connectivity to other hosts on the lan) ((and only when using dhcp))
2. Should I use something other than dhcpd (even when I don't start openvpn) dhcpcd seems unreliable between reboots, meaning sometimes it gets an address (always the same because I added it to router by mac), and other times I need to use a keyboard and locally run Code:dhcpcd eth0 after the box is online.
NOTE system info: more info this is a SOC x86_64 with 2 interfaces. (JUST USING ONE TODAY)
root@gatekeeper:~# neofetch --stdout
root@gatekeeper.lehcar.duckdns.org
----------------------------------
OS: Slackware 14.2 x86_64 (post 14.2 -current) x86_64
Host: Super Server 0123456789
Kernel: 5.4.72
Uptime: 2 hours, 54 mins
Packages: 1343 (pkgtool)
Shell: bash 5.0.18
Resolution: 1280x1024
CPU: Intel Atom E3940 (4) @ 1.800GHz
GPU: Intel HD Graphics 500
Memory: 107MiB / 7785MiB
root@gatekeeper:~# inxi
CPU: Quad Core Intel Atom E3940 (-MCP-) speed/min/max: 1182/800/1800 MHz Kernel: 5.4.72 x86_64 Up: 2h 55m
Mem: 155.8/7786.0 MiB (2.0%) Storage: 119.24 GiB (10.8% used) Procs: 107 Shell: inxi: 3.1.05


I'm having a interesting issue like this one:
https://bugs.launchpad.net/ubuntu/+s...n/+bug/1598522
Symptom is: When I start openvpn I loose connectivity to all hosts on my lan, and when rebooting Often times I don't get an IP assigned to the interface (eth0) and need to run dhcpcd eth0
Note: Similar in symptom only (no systemd etc)
I should add for my network configuration I am using /etc/rc.d/rc.inet1.conf
- using this:
Code:# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
IPALIASES[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""- Then as usual /etc/rc.d/rc.inet2 (starts openvpn because I have rc.openvpn exectable)
What I noticed is eth0 does not get an IP fast enough, (if I set the address static, I'm fine, but if I allow dhcpcd to negotiate for address it seems to consistently not get an address before openvpn tries to bind and disrupts the process)
Still in the testing Phase.
(couple ideas are add /usr/bin/sleep 10 to /etc/rc.d/rc.inet2 --seems poor idea don't like messing here)
could mark it non-executable then add something in rc.local to do it (maybe with a 10 second sleep before it)
-- I'll investigate further... (wondering if anyone else experiences)
***After a bit more testing it seems my real problem is using dhcpd and openvpn.
I had been using dhcp yes (with a static-ip set in the router, by mac)
After I set the static address in inet1.conf all issue evaporated (went away).
so changed to static via inet1.conf
Code:# Config information for eth0:
IPADDR[0]="192.168.157.203"
NETMASK[0]="255.255.255.0"
IPALIASES[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Default gateway IP address:
GATEWAY="192.168.157.1"
Two questions:
1. I really would like to leave this interface with dhcp. (Plan to turn this into a Slackware home router ((has 2 interfaces only currently using 1))) Am I missing something to use dhcpcd and openvpn? (when I start openvpn I loose connectivity to other hosts on the lan) ((and only when using dhcp))
2. Should I use something other than dhcpd (even when I don't start openvpn) dhcpcd seems unreliable between reboots, meaning sometimes it gets an address (always the same because I added it to router by mac), and other times I need to use a keyboard and locally run Code:dhcpcd eth0 after the box is online.
NOTE system info: more info this is a SOC x86_64 with 2 interfaces. (JUST USING ONE TODAY)
root@gatekeeper:~# neofetch --stdout
root@gatekeeper.lehcar.duckdns.org
----------------------------------
OS: Slackware 14.2 x86_64 (post 14.2 -current) x86_64
Host: Super Server 0123456789
Kernel: 5.4.72
Uptime: 2 hours, 54 mins
Packages: 1343 (pkgtool)
Shell: bash 5.0.18
Resolution: 1280x1024
CPU: Intel Atom E3940 (4) @ 1.800GHz
GPU: Intel HD Graphics 500
Memory: 107MiB / 7785MiB
root@gatekeeper:~# inxi
CPU: Quad Core Intel Atom E3940 (-MCP-) speed/min/max: 1182/800/1800 MHz Kernel: 5.4.72 x86_64 Up: 2h 55m
Mem: 155.8/7786.0 MiB (2.0%) Storage: 119.24 GiB (10.8% used) Procs: 107 Shell: inxi: 3.1.05