mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Merge remote-tracking branch 'cumulus/dev'
This commit is contained in:
@ -3,6 +3,10 @@
|
||||
import argparse
|
||||
import sys
|
||||
import subprocess
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import os
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
""" This script prints to stdout /etc/network/interfaces entries for
|
||||
requested interfaces.
|
||||
@ -30,6 +34,7 @@ import subprocess
|
||||
|
||||
"""
|
||||
|
||||
<<<<<<< HEAD
|
||||
def get_swp_interfaces():
|
||||
porttab_path = '/var/lib/cumulus/porttab'
|
||||
ports = []
|
||||
@ -43,6 +48,49 @@ def get_swp_interfaces():
|
||||
ports.append(line.split()[0])
|
||||
except ValueError:
|
||||
continue
|
||||
=======
|
||||
def get_pci_interfaces():
|
||||
ports = []
|
||||
FNULL = open(os.devnull, 'w')
|
||||
try:
|
||||
cmd = '(ip -o link show | grep -v "@" | cut -d" " -f2 | sed \'s/:$//\')'
|
||||
output = subprocess.check_output(cmd, shell=True).split()
|
||||
for interface in output:
|
||||
cmd = 'udevadm info -a -p /sys/class/net/%s | grep \'SUBSYSTEMS=="pci"\'' % interface
|
||||
try:
|
||||
subprocess.check_call(cmd, shell=True, stdout=FNULL)
|
||||
ports.append(interface)
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
FNULL.close()
|
||||
return ports
|
||||
|
||||
def get_swp_interfaces():
|
||||
porttab_path = '/var/lib/cumulus/porttab'
|
||||
ports = []
|
||||
try:
|
||||
with open(porttab_path, 'r') as f:
|
||||
for line in f.readlines():
|
||||
line = line.strip()
|
||||
if '#' in line:
|
||||
continue
|
||||
try:
|
||||
ports.append(line.split()[0])
|
||||
except ValueError:
|
||||
continue
|
||||
except:
|
||||
try:
|
||||
ports = get_pci_interfaces()
|
||||
except Exception as e:
|
||||
print 'Error: Unsupported script: %s' % str(e)
|
||||
exit(1)
|
||||
if not ports:
|
||||
print 'Error: No ports found in %s' % porttab_path
|
||||
exit(1)
|
||||
>>>>>>> cumulus/dev
|
||||
return ports
|
||||
|
||||
def print_swp_defaults_header():
|
||||
@ -138,9 +186,12 @@ if args.bridgedefault and args.mergefile:
|
||||
exit(1)
|
||||
|
||||
swp_intfs = get_swp_interfaces()
|
||||
<<<<<<< HEAD
|
||||
if not swp_intfs:
|
||||
print 'error: no ports found'
|
||||
exit(1)
|
||||
=======
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
if args.swpdefaults:
|
||||
interfaces_print_swp_defaults(swp_intfs)
|
||||
|
@ -21,16 +21,27 @@ iface swp30
|
||||
alias "test network"
|
||||
link-duplex full
|
||||
link-speed 1000
|
||||
<<<<<<< HEAD
|
||||
link-autoneg off
|
||||
=======
|
||||
link-autoneg no
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
# bond interface
|
||||
auto bond3
|
||||
iface bond3 inet static
|
||||
<<<<<<< HEAD
|
||||
address 100.0.0.4/16
|
||||
bond-slaves swp1 swp2
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-slaves swp1 swp2
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit_hash_policy layer3+4
|
||||
@ -38,16 +49,27 @@ iface bond3 inet static
|
||||
# bond interface
|
||||
auto bond4
|
||||
iface bond4 inet static
|
||||
<<<<<<< HEAD
|
||||
address 100.0.0.6/16
|
||||
bond-slaves swp3 swp4
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-slaves swp3 swp4
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit_hash_policy layer3+4
|
||||
|
||||
<<<<<<< HEAD
|
||||
# bond interface
|
||||
=======
|
||||
# bridge interface
|
||||
>>>>>>> cumulus/dev
|
||||
auto br0
|
||||
iface br0
|
||||
address 12.0.0.4/24
|
||||
@ -59,11 +81,17 @@ iface br0
|
||||
# vlan interface on bond
|
||||
auto bond3.2000
|
||||
iface bond3.2000 inet static
|
||||
<<<<<<< HEAD
|
||||
address 100.1.0.4/16
|
||||
|
||||
auto bond4.2000
|
||||
iface bond4.2000 inet static
|
||||
address 100.1.0.6/16
|
||||
=======
|
||||
|
||||
auto bond4.2000
|
||||
iface bond4.2000 inet static
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
auto br2000
|
||||
iface br2000 inet6 static
|
||||
|
@ -31,11 +31,19 @@ iface br-300 inet static
|
||||
mstpctl-hello 2
|
||||
mstpctl-portnetwork swp13.300=no
|
||||
bridge-mclmc 3
|
||||
<<<<<<< HEAD
|
||||
bridge-mcrouter 0
|
||||
bridge-mcsnoop 1
|
||||
bridge-mcsqc 3
|
||||
bridge-mcqifaddr 1
|
||||
bridge-mcquerier 1
|
||||
=======
|
||||
bridge-mcrouter no
|
||||
bridge-mcsnoop yes
|
||||
bridge-mcsqc 3
|
||||
bridge-mcqifaddr yes
|
||||
bridge-mcquerier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bridge-hashel 3
|
||||
bridge-hashmax 4
|
||||
bridge-mclmi 3
|
||||
|
16
docs/examples/mgmt-vrf
Normal file
16
docs/examples/mgmt-vrf
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
# Example config for management VRF
|
||||
# - 'vrf-default-route no' tells ifupdown2 not to install
|
||||
# the default unreachable route (dhclient will add the
|
||||
# default route)
|
||||
|
||||
auto eth0
|
||||
iface eth0 inet dhcp
|
||||
vrf mgmt
|
||||
|
||||
auto mgmt
|
||||
iface mgmt
|
||||
address 127.0.0.1/8
|
||||
vrf-table auto
|
||||
vrf-default-route no
|
||||
|
@ -23,7 +23,11 @@ iface uplink1
|
||||
bond-slaves swp32
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer2
|
||||
@ -35,7 +39,11 @@ iface peerlink
|
||||
bond-slaves swp30 swp31
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
@ -47,7 +55,11 @@ iface downlink
|
||||
bond-slaves swp1
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
|
@ -25,7 +25,11 @@ iface spine-bond
|
||||
bond-slaves glob swp19-22
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
@ -38,7 +42,11 @@ iface peer-bond
|
||||
bond-slaves glob swp23-24
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
@ -61,7 +69,11 @@ iface host-bond-01
|
||||
bond-slaves swp1
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
@ -72,7 +84,11 @@ iface host-bond-02
|
||||
bond-slaves swp2
|
||||
bond-mode 802.3ad
|
||||
bond-miimon 100
|
||||
<<<<<<< HEAD
|
||||
bond-use-carrier 1
|
||||
=======
|
||||
bond-use-carrier yes
|
||||
>>>>>>> cumulus/dev
|
||||
bond-lacp-rate 1
|
||||
bond-min-links 1
|
||||
bond-xmit-hash-policy layer3+4
|
||||
|
Reference in New Issue
Block a user