Bug 1326164 - [WALA][rhel6.8]waagent fails to set default gateway
Summary: [WALA][rhel6.8]waagent fails to set default gateway
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: WALinuxAgent
Version: 6.8
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Yue Zhang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1359574 1366045 1387784
TreeView+ depends on / blocked
 
Reported: 2016-04-12 02:45 UTC by Yuxin Sun
Modified: 2016-11-16 06:20 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-09 08:48:28 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Yuxin Sun 2016-04-12 02:45:01 UTC
Description of problem:
The command in the setDefaultGatway function in waagent is incorrect.

Version-Release number of selected component (if applicable):
WALinuxAgent-2.0.16-1.el6

How reproducible:
Always

Steps to Reproduce:
1. Prepare a VM on Azure and login.
2. Enable the verbose log. Enable the error log of the "setDefaultGateway" function in class AbstractDistro
# vi /etc/waagent.conf, set Logs.Verbose=y
# vi /usr/sbin/waagent, find the "setDefaultGatway" function in class AbstractDistro, set "chk_err=True"
3. service waagent restart
4. Check the /var/log/waagent.log

Actual results:
The set default gateway command is "/sbin/route add default gw172.19.0.1" which is incorrect, so that it cannot be executed successfully.

Messages in /var/log/waagent.log:
2016/04/08 02:52:39 Set default gateway: 172.19.0.1
2016/04/08 02:52:39 /sbin/route add default gw172.19.0.1
2016/04/08 02:52:39 ERROR:CalledProcessError.  Error Code is 7
2016/04/08 02:52:39 ERROR:CalledProcessError.  Command string was /sbin/route add default gw172.19.0.1
2016/04/08 02:52:39 ERROR:CalledProcessError.  Command result was SIOCADDRT: No such device

Expected results:
The set default gateway command is correct.

Additional info:
The root cause is there's no space between "gw" and gateway address in the setDefaultGateway function in class AbstractDistro.

Comment 3 Yuxin Sun 2016-08-09 08:48:28 UTC
Fixed in WALinuxAgent-2.1.5. Verify and close it.

*** This bug has been marked as a duplicate of bug 1360493 ***


Note You need to log in before you can comment on or make changes to this bug.