Commit 0292374c authored by Mark Schouten's avatar Mark Schouten
Browse files

Add lltest example

parent e1873388
#!/usr/bin/env python3
"""This script should be able to create a configfile from all the current (supported) interfaces"""
import sys
from socket import AF_INET
from pyroute2 import IPRoute
from pprint import pprint
from pyroute2 import IPDB
from tabulate import tabulate
from yaml import load, dump
from time import sleep
#from pyface import Iface, Vlan
ip = IPDB()
parent = ip.interfaces['eth1']
i = ip.interfaces['lltest']
i.remove()
ip.commit()
i = ip.create(kind='vlan', ifname='lltest', link=parent, vlan_id=1234, reuse=True)
i.up()
ip.commit()
print("Waiting for fe80 address")
i.wait_ip('fe80::', mask=64)
pprint(i)
i.add_ip('fc00::1:1:1:1/64')
ip.commit()
pprint(i['ipaddr'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment