From 9076136aba1429a57db1db34b6d2093e3815ee54 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 8 Sep 2015 17:44:13 +0000 Subject: base-files: add /etc/iproute2/rt_tables, replace ifconfig-usage Signed-off-by: Steven Barth git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46830 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/Makefile | 3 ++- package/base-files/files/etc/iproute2/rt_tables | 11 +++++++++++ package/base-files/files/lib/preinit/10_indicate_preinit | 6 ++++-- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 package/base-files/files/etc/iproute2/rt_tables diff --git a/package/base-files/Makefile b/package/base-files/Makefile index bd5e2bc530..c33a3dc104 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk PKG_NAME:=base-files -PKG_RELEASE:=158 +PKG_RELEASE:=159 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ PKG_BUILD_DEPENDS:=opkg/host usign/host @@ -57,6 +57,7 @@ define Package/base-files/conffiles /etc/crontabs/ /etc/sysctl.d/local.conf /etc/sysctl.d/ +/etc/iproute2/rt_tables $(call $(TARGET)/conffiles) endef diff --git a/package/base-files/files/etc/iproute2/rt_tables b/package/base-files/files/etc/iproute2/rt_tables new file mode 100644 index 0000000000..541abfd272 --- /dev/null +++ b/package/base-files/files/etc/iproute2/rt_tables @@ -0,0 +1,11 @@ +# +# reserved values +# +255 local +254 main +253 default +0 unspec +# +# local +# +#1 inr.ruhep diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 8e94df9ab2..1fab8a20ad 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -10,13 +10,15 @@ preinit_ip() { fi [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { - ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up + ip link set dev $pi_ifname up + ip -4 address add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $pi_ifname } } preinit_ip_deconfig() { [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { - ifconfig $pi_ifname 0.0.0.0 down + ip -4 address flush dev $pi_ifname + ip link set dev $pi_ifname down } } -- cgit v1.2.3