Bug 233937

Summary: YaST@ writes dhcpd.conf that is incorrect
Product: [openSUSE] openSUSE 10.2 Reporter: Mark Van De Vyver <mvdv>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None    
Version: RC 5   
Target Milestone: ---   
Hardware: i586   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: YaST2 logs

Description Mark Van De Vyver 2007-01-12 05:00:11 UTC
I'm a linux novice hence the 'major' severity.
Using the YaST2 GUI to follow 'HOW-TO: Set Up a SUSE 10 Machine As a Router'
http://www.novell.com/coolsolutions/feature/16579.html
I encounter a problem when setting up the DHCP server - The DHCP server will not start when I click 'Finish'.

/var/log/messages shows:

Jan 12 15:33:41 mv-laptop dhcpd: /var/lib/dhcp///etc/dhcpd.conf line 7: expecting numeric value.
Jan 12 15:33:41 mv-laptop dhcpd: subnet  netmask
Jan 12 15:33:41 mv-laptop dhcpd:         ^
Jan 12 15:33:41 mv-laptop dhcpd: Configuration file errors encountered -- exiting


It turns out the problem is that the /etc/dhcp.conf file is written incorrectly by YaST2.  YaST2 writes:

option domain-name "sable.net";
option domain-name-servers 203.98.90.25, 203.98.90.27;
option routers 192.168.0.1;
option ntp-servers time.nist.gov;
ddns-update-style none;
default-lease-time 14400;
subnet  netmask {
  range 192.168.0.100 192.168.0.250;
  default-lease-time 14400;
  max-lease-time 172800;
}

But this should be

option domain-name "sable.net";
option domain-name-servers 203.98.90.25, 203.98.90.27;
option routers 192.168.0.1;
option ntp-servers time.nist.gov;
ddns-update-style none;
default-lease-time 14400;
subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.100 192.168.0.250;
  default-lease-time 14400;
  max-lease-time 172800;
}
Comment 1 Matej Horvath 2007-01-12 10:30:40 UTC
Could you post your yast logs, please?
http://en.opensuse.org/Bugs/YaST

Thank you.
Comment 2 Mark Van De Vyver 2007-01-13 06:32:20 UTC
Created attachment 112836 [details]
YaST2 logs
Comment 3 Katarina Machalkova 2007-01-22 12:16:51 UTC
Hm, seems as if YaST DHCP module failed to retrieve information on current network and subnet (hence incomplete subnet and network declaration). The log says: 

2007-01-12 15:17:31 <1> mv-laptop(8741) [Perl] modules/DhcpServer.pm(DhcpServer::GetInterfaceInformation):2220 Getting information about interface eth-id-00:12:3f:e7:71:b7
2007-01-12 15:17:32 <3> mv-laptop(8741) [Perl] modules/DhcpServer.pm(DhcpServer::GetInterfaceInformation):2259 ifconfig didn't return meaningful data about eth0

I wonder why that might be. Mark, are you using NetworkManager ? Does network normally work for you ?

Comment 4 Katarina Machalkova 2007-01-22 13:10:19 UTC
Forget the needinfo :-) 
This always happens if selected interface (for dhcp-server to listen on) is not up at the moment, hence ifconfig does not provide any reasonable info about it and current subnet and netmask therefore cannot be calculated. 
Comment 5 Katarina Machalkova 2007-01-22 17:13:05 UTC
Ok, I've made gathering information about the interface a bit smarter, yet not 100% foolproof - it will never work for interfaces with DHCP address. 

But anyway, DHCP server on NIC that has IP address assigned in other way than statically makes no sense ;-)

Fixed in yast2-dhcp-server 2.15.1 (openSUSE) and 2.13.12 (SLES/D)