Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenepaniot committed Aug 16, 2018
0 parents commit 78fb00a
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Place these scripts in `/etc/sysconfig/network-scripts` on your
RedHat/CentOS/Fedora system.

Sample configuration for a `vxlan` interface:

TYPE=VXLAN
DEVICE=vxlan1000
BOOTPROTO=none
ONBOOT=yes
TTL=255
VNI=1000
DSTPORT=4789
LOCAL_ADDR="192.168.1.1"
PHYS_DEV="eth0"
OPTIONS="nolearning"
BRIDGE="br1000"

18 changes: 18 additions & 0 deletions ifdown-vxlan
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions

[ -f ../network ] && . ../network

CONFIG=$1
need_config "$CONFIG"
source_config

/sbin/ip link set dev "$DEVICE" down
/sbin/ip link del "$DEVICE"

exec /etc/sysconfig/network-scripts/ifdown-eth "$CONFIG"
exec /etc/sysconfig/network-scripts/ifdown-post "$CONFIG"
25 changes: 25 additions & 0 deletions ifup-vxlan
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

. /etc/init.d/functions

cd /etc/sysconfig/network-scripts
. ./network-functions

[ -f ../network ] && . ../network

CONFIG=${1}

need_config ${CONFIG}

source_config

exec /etc/sysconfig/network-scripts/ifup ${PHYS_DEV}

ip link add ${DEVICE} type vxlan \
id ${VNI} \
dstport ${DSTPORT:-4789} \
local ${LOCAL_ADDR} \
ttl ${ttl:-255} \
dev ${PHYS_DEV} ${OPTIONS}

exec /etc/sysconfig/network-scripts/ifup-eth ${DEVICE}
Binary file added initscripts-vxlan-0.1-1.x86_64.rpm
Binary file not shown.
38 changes: 38 additions & 0 deletions initscripts-vxlan.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Name: initscripts-vxlan
Version: 0.1
Release: 1%{?dist}
Summary: vxlan ifup/down scripts
Packager: Eugene Paniot <[email protected]>
Group: System Environment/Base
License: GPLv2 and GPLv2+
URL: https://github.com/eugenepaniot/initscripts-vxlan

Source: %{name}-%{version}.tar.gz

Requires: initscripts >= 9.49.30
Requires: iproute >= 3.10


%description
initscripts-macvlan provides scripts to manage macvlan netwok intefaces on the host machine

%prep
%setup -q


%install
%{__mkdir} -p %{buildroot}/etc/sysconfig/network-scripts

%{__install} -p -m 0755 ifup-vxlan %{buildroot}/etc/sysconfig/network-scripts/
%{__install} -p -m 0755 ifdown-vxlan %{buildroot}/etc/sysconfig/network-scripts/

%files
%defattr(-,root,root)
/etc/sysconfig/network-scripts/ifup-vxlan
/etc/sysconfig/network-scripts/ifdown-vxlan

%doc


%changelog

0 comments on commit 78fb00a

Please sign in to comment.