Based upon https://phabricator.vyos.net/T173#3019 it should be possible to make a per interface setting configurable. According to http://manpages.ubuntu.com/manpages/trusty/man8/dhclient-script.8.html the variable $interface should contain the interface to match on.
Description
Description
Details
Details
- Version
- -
- Is it a breaking change?
- Perfectly compatible
- Issue type
- Feature (new functionality)
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | BUG | zsdc | T173 Static routes ignored with DHCP received gateway | ||
Resolved | FEATURE REQUEST | Viacheslav | T208 Ability to ignore default-route from dhcpcd per interface |
Event Timeline
Comment Actions
I wrote this hook script
Any available options ignoring this code
Create and edit hook script file
nano /etc/dhcp/dhclient-enter-hooks.d/ignore-options
Copy and Paste this code into ignore-options hook script
confdir="/etc/dhcp/ignore_options" if [ -f ${confdir}/${interface} ] then case ${reason} in BOUND|RENEW|REBIND|REBOOT) options=$(cat ${confdir}/${interface} | grep -v "^#") for option in ${options} do eval "var=\$${option}" if [ -n "${var}" ]; then unset ${option} fi done ;; esac fi
Create directory
mkdir /etc/dhcp/ignore_options
Create interface file and edit
nano /etc/dhcp/ignore_options/eth0
then add line by line options into interface conf file
for examle.
new_routers new_static_routes new_rfc3442_classless_static_routes new_domain_name new_domain_name_servers new_netbios_name_servers new_ntp_servers
ALL available options
new_alias_ip_address new_ip_address new_host_name new_network_number new_subnet_mask new_broadcast_address new_routers new_static_routes new_rfc3442_classless_static_routes new_domain_name new_domain_search new_domain_name_servers new_netbios_name_servers new_netbios_scope new_ntp_servers new_ip6_address new_ip6_prefix ip6_prefixlen new_dhcp6_domain_search new_dhcp6_name_servers
Comment Actions
I'm sorry for the belated response. This is great. Thanks for your contribution @fatihusta! Once testing checks out I'll add this to my CLI integration todo.
Comment Actions
Fixed in T2997
set interfaces ethernet eth1 address 'dhcp' set interfaces ethernet eth1 dhcp-options no-default-route