#!/usr/bin/env bash
f=/etc/network/interfaces
mac=$(ip address show eth0  | grep ether| awk '{print $2}')
echo "source /etc/network/interfaces.d/*

allow-hotplug eth0
no-auto-down eth0
iface eth0 inet dhcp
hwaddress ether ${mac}



auto lo
iface lo inet loopback" > $f
echo "当前配置参数如下"
cat $f
echo "已完成配置,如需验证请执行reboot命令重启进行对比"