diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-06 21:07:46 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-06 21:07:46 +0100 |
commit | bebd084651b50171e696af232a9c403f69ac6230 (patch) | |
tree | 6fc3a74465c94f1536d77fd3fc0f0dcc9cf47148 /python/vyos/ifconfig.py | |
parent | a96ffc33cc63918ba3815f66c506c717a8676621 (diff) | |
parent | 1ac177febfdd0dfc5a5b40a1b30294de0e2a45e0 (diff) | |
download | vyos-1x-bebd084651b50171e696af232a9c403f69ac6230.tar.gz vyos-1x-bebd084651b50171e696af232a9c403f69ac6230.zip |
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x:
openvpn: bridge: T1556: remove obsolete bridge-group definition
ifconfig: T1849: fix DHCPv6 startup
Python/VyOS validate: T1849: handle is_ipv6()/is_ipv6() exceptions
ifconfig: T1793: remove dhcpv6 client debug output
ddclient: T1853: bugfix TypeError exception
syslog: T1845: syslog host no longer accepts a port
syslog: code formatting
syslog: T1845: syslog host no longer accepts a port
syslog: renaming files and conf script to fit new scheme
T1855, T1826: clean up the reboot/shutdown script.
wireguard: T1853: disable peer doesn't work
Revert "syslog: T1845: syslog host no longer accepts a port"
dmvpn: T1784: Add swanctl load call
syslog: T1845: syslog host no longer accepts a port
[vyos.config] T1847: correctly set_level for path given as empty string
Diffstat (limited to 'python/vyos/ifconfig.py')
-rw-r--r-- | python/vyos/ifconfig.py | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index f487e6a5b..72f11c04d 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -615,8 +615,6 @@ class Interface: >>> j.set_dhcpv6() """ dhcpv6 = self.get_dhcpv6_options() - import pprint - pprint.pprint(dhcpv6) # better save then sorry .. should be checked in interface script # but if you missed it we are safe! @@ -629,33 +627,32 @@ class Interface: with open(self._dhcpv6_cfg_file, 'w') as f: f.write(dhcpv6_text) - if self.get_state() == 'up': - # https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1447715 - # - # wee need to wait for IPv6 DAD to finish once and interface is added - # this suxx :-( - sleep(5) - - # no longer accept router announcements on this interface - self._write_sysfs('/proc/sys/net/ipv6/conf/{}/accept_ra' - .format(self._ifname), 0) - - # assemble command-line to start DHCPv6 client (dhclient) - cmd = 'start-stop-daemon --start --quiet --pidfile ' + \ - self._dhcpv6_pid_file - cmd += ' --exec /sbin/dhclient --' - # now pass arguments to dhclient binary - cmd += ' -6 -nw -cf {} -pf {} -lf {}'.format( - self._dhcpv6_cfg_file, self._dhcpv6_pid_file, self._dhcpv6_lease_file) - - # add optional arguments - if dhcpv6['dhcpv6_prm_only']: - cmd += ' -S' - if dhcpv6['dhcpv6_temporary']: - cmd += ' -T' - - cmd += ' {}'.format(self._ifname) - return self._cmd(cmd) + # https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1447715 + # + # wee need to wait for IPv6 DAD to finish once and interface is added + # this suxx :-( + sleep(5) + + # no longer accept router announcements on this interface + self._write_sysfs('/proc/sys/net/ipv6/conf/{}/accept_ra' + .format(self._ifname), 0) + + # assemble command-line to start DHCPv6 client (dhclient) + cmd = 'start-stop-daemon --start --quiet --pidfile ' + \ + self._dhcpv6_pid_file + cmd += ' --exec /sbin/dhclient --' + # now pass arguments to dhclient binary + cmd += ' -6 -nw -cf {} -pf {} -lf {}'.format( + self._dhcpv6_cfg_file, self._dhcpv6_pid_file, self._dhcpv6_lease_file) + + # add optional arguments + if dhcpv6['dhcpv6_prm_only']: + cmd += ' -S' + if dhcpv6['dhcpv6_temporary']: + cmd += ' -T' + + cmd += ' {}'.format(self._ifname) + return self._cmd(cmd) def _del_dhcpv6(self): |