LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-28-2015, 03:55 AM   #1
slockna
LQ Newbie
 
Registered: Jul 2015
Location: Sweden
Distribution: Slackware, zenwalk, debian
Posts: 28

Rep: Reputation: Disabled
default gateway route is not set by dhcp


my slackware computer (fresh setup from current iso Jun 23 ) will not use the route to default gateway provided by dhcp.

i am on a wireless network configured in rc.inet1.conf:

i also have an eth0 device that is not in use so it is not configured here.


Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]=""
NETMASK[2]=""
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

# Config information for eth3:
IPADDR[3]=""
NETMASK[3]=""
USE_DHCP[3]=""
DHCP_HOSTNAME[3]=""

# Default gateway IP address:
#GATEWAY=""

# Change this to "yes" for debugging output to stdout.  Unfortunately,
# /sbin/hotplug seems to disable stdout so you'll only see debugging output
# when rc.inet1 is called directly.
DEBUG_ETH_UP="no"


# Example of how to configure a bridge:
# Note the added "BRNICS" variable which contains a space-separated list
# of the physical network interfaces you want to add to the bridge.
#IFNAME[0]="br0"
#BRNICS[0]="eth0"
#IPADDR[0]="192.168.0.1"
#NETMASK[0]="255.255.255.0"
#USE_DHCP[0]=""
#DHCP_HOSTNAME[0]=""

## Example config information for wlan0.  Uncomment the lines you need and fill
## in your info.  (You may not need all of these for your wireless network)
IFNAME[4]="wlan0"
#IPADDR[4]=""
#NETMASK[4]=""
USE_DHCP[4]="yes"
DHCP_HOSTNAME[4]="acer"
#DHCP_KEEPRESOLV[4]="yes"
#DHCP_KEEPNTP[4]="yes"
#DHCP_KEEPGW[4]="yes"
#DHCP_IPADDR[4]=""
WLAN_ESSID[4]=R279
WLAN_MODE[4]=Managed
##WLAN_RATE[4]="54M auto"
##WLAN_CHANNEL[4]="auto"
##WLAN_KEY[4]="D5AD1F04ACF048EC2D0B1C80C7"
WLAN_IWPRIV[4]="set AuthMode=WPAPSK | set EncrypType=TKIP | set WPAPSK=hemligthe
mligt"
WLAN_WPA[4]="wpa_supplicant"
#WLAN_WPADRIVER[4]="ndiswrapper"
 
Old 07-28-2015, 04:38 AM   #2
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Just an idea. Try to simply uncomment GATEWAY="", but leave it empty.
 
Old 07-28-2015, 05:45 AM   #3
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
In most cases, as soon as you're running Slackware with a GUI, you'll be better off using NetworkManager with a wireless card. Works perfectly.
 
Old 07-28-2015, 02:15 PM   #4
slockna
LQ Newbie
 
Registered: Jul 2015
Location: Sweden
Distribution: Slackware, zenwalk, debian
Posts: 28

Original Poster
Rep: Reputation: Disabled
default gateway route is not set by dhcp

Well I tried briefly with Kde but it was way too slow for that computer. Could not get wireless working at all with NM anyway so I uninstalled Kde. I will mostly play around with this computer for web related stuff, so I really don't need a gui.
BTW, blanking the gateway line did not help me either.
 
Old 07-28-2015, 03:32 PM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I would recommend simplifying your rc.inet1.conf and use wpa_supplicant.conf for configuring your wireless networks.

Code:
#/etc/rc.d/rc.inet1.conf

--[snip]--
 
IFNAME[4]="wlan0"
#IPADDR[4]=""
#NETMASK[4]=""
USE_DHCP[4]="yes"
WLAN_ESSID[4]=""
WLAN_MODE[4]=Managed
WLAN_WPA[4]="wpa_supplicant"
Code:
#/etc/wpa_supplicant.conf

network={
  scan_ssid=1
  ssid="nest"
  key_mgmt=WPA-PSK
  psk="secret passphrase"
}
You can easily generate your wpa_supplicant.conf using wpa_passphrase by doing wpa_passphrase SSID password >> /etc/wpa_supplicant.conf

For the info you provided in your rc.inet1.conf, I went ahead and ran the command for you. It should add something like the following to your /etc/wpa_supplicant.conf (first line is the command I ran)

Code:
jbhansen@craven-moorhead:~$ wpa_passphrase R279 hemligthemligt
network={
        ssid="R279"
        #psk="hemligthemligt"
        psk=6c2dabd98de6f2d58d7d40897ac526696771ae3872835eb01a7146b58d6ba769
}
If you continue to run into issues after that, I'd recommend trying to just use wpa_supplicant to connect, as it should help by providing output on what errors it is running into.

Code:
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -dd
 
Old 07-28-2015, 05:55 PM   #6
slockna
LQ Newbie
 
Registered: Jul 2015
Location: Sweden
Distribution: Slackware, zenwalk, debian
Posts: 28

Original Poster
Rep: Reputation: Disabled
default gateway route is not set by dhcp

Connecting is fine, I get a connection by wpa-supplicant somehow. Probably made a mess of it but it works...
I want all routes handled by dhcp. I get all routes but one...


root@acer:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.0 plutten 255.255.255.0 UG 303 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
192.168.35.0 * 255.255.255.0 U 303 0 0 wlan0
root@acer:~#

As you see there is no default (Internet) route in there.
 
Old 07-28-2015, 06:55 PM   #7
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64
Posts: 364

Rep: Reputation: 67
Alien Bob's http://alien.slackbook.org/dokuwiki/...ckware:network helped me the most with wireless configuration.
Specifically this section: http://alien.slackbook.org/dokuwiki/...in_rcinet1conf.
 
Old 07-29-2015, 06:41 AM   #8
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
What are you using to resolve your IP address? dhcpcd or dhclient? Do any of those provide any output that could possibly be helpful in solving this?
 
Old 07-29-2015, 07:16 AM   #9
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by bassmadrigal View Post
What are you using to resolve your IP address? dhcpcd or dhclient? Do any of those provide any output that could possibly be helpful in solving this?
I would hazard a guess the problem is with his OpenVPN configuration.
 
Old 07-29-2015, 12:15 PM   #10
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by gezley View Post
I would hazard a guess the problem is with his OpenVPN configuration.
Looking at that routing table could suggest that he is using OpenVPN and OpenVPN isn't pushing the right routes.


If that is not the case, then it would be especially helpful if some logs or debugging output were posted.
 
Old 07-29-2015, 12:53 PM   #11
slockna
LQ Newbie
 
Registered: Jul 2015
Location: Sweden
Distribution: Slackware, zenwalk, debian
Posts: 28

Original Poster
Rep: Reputation: Disabled
yep, gotta look exactly at what dnsmasq is serving. i see no delault route in the debug output.
one thing that does work is the reverse route to openvpn ;-)

Code:
Jul 29 15:29:18 acer logger: /etc/rc.d/rc.inet1:  /sbin/dhcpcd -t 10 -h acer -d 
wlan0
Jul 29 15:29:18 acer dhcpcd[625]: wlan0: adding address fe80::a0a4:d78a:7206:7ad
f
Jul 29 15:29:18 acer dhcpcd[625]: DUID 00:01:00:01:1d:34:c0:c0:00:23:8b:01:9d:6b
Jul 29 15:29:18 acer dhcpcd[625]: wlan0: IAID 4d:a4:56:1c
Jul 29 15:29:19 acer dhcpcd[625]: wlan0: soliciting a DHCP lease
Jul 29 15:29:21 acer dhcpcd[625]: wlan0: offered 192.168.35.140 from 192.168.35.
5
Jul 29 15:29:26 acer dhcpcd[625]: wlan0: leased 192.168.35.140 for 43200 seconds
Jul 29 15:29:26 acer dhcpcd[625]: wlan0: adding route to 192.168.35.0/24
Jul 29 15:29:26 acer dhcpcd[625]: wlan0: adding route to 10.8.0.0/24 via 192.168
.35.5
Jul 29 15:29:27 acer dhcpcd[625]: forked to background, child pid 651
 
Old 07-29-2015, 05:49 PM   #12
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by slockna View Post
yep, gotta look exactly at what dnsmasq is serving. i see no delault route in the debug output.
one thing that does work is the reverse route to openvpn ;-)
Are other machines on your network having difficulty getting the default route? Have you tried switching out dhcpcd for dhclient?

If you scroll down in these docs to the bottom of the "Manual Configuration" section, you will note the following:

Quote:
Why does Slackware include two DHCP clients? Sometimes a particular DHCP server may be broken and not respond well to either dhcpcd or dhclient. In those cases, you can fall back to the other DHCP client in hopes of getting a valid response from the server. Traditionally, Slackware uses dhcpcd, and this works in the vast majority of cases, but it may become necessary at some point for you to use dhclient instead. Both are excellent DHCP clients, so use whichever you prefer.
I can attest to this being accurate with some routers that serve DHCP addresses. In most cases a firmware update on the router is necessary. I did not experience this with Slackware, but I have with Debian in the past.

Stop all networking...
Code:
# sh /etc/rc.d/rc.inet1 stop  && sh /etc/rc.d/rc.wireless stop
....and restart it manually as suggested in this documentation. Then when you bring up the NIC, run dhclient for wlan0.
Code:
# dhclient wlan0 -d -v
Please post the output here.
 
1 members found this post helpful.
Old 07-31-2015, 04:20 AM   #13
slockna
LQ Newbie
 
Registered: Jul 2015
Location: Sweden
Distribution: Slackware, zenwalk, debian
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thanks, i have now tried dhclient, but the result is the same

My DHCP server is dnsmasq on raspbian and i use dhcp options to propagate the route to the vpn interface.

if i comment out this alternate static route i get the default route set correctly. i feel my problems are NOT in the slackware setup...

strangely enough, other systems can accept the correct gateway despite this "glitch" (windows 7 ,windows xp,Android, zenwalk 64 )

i will keep researching !
 
  


Reply

Tags
dhcpcd, route, slackware 14.1



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to set default route when gateway has dynamic IP? charlweed Linux - Networking 1 05-27-2014 02:45 PM
Having trouble with default route/gateway x2r3x Linux - Networking 4 07-28-2011 05:32 PM
Default gateway not being set when using DHCP ret602 Linux - Networking 1 09-20-2007 12:17 PM
How programatically in C do I get/set the default route or gateway address of eth0 jroberts5477 Linux - Networking 2 09-15-2006 01:11 PM
default route without a gateway scylla Linux - Networking 1 10-21-2004 01:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration