IP

In this section we describe the IP configuration:

IP configuration is available regardless the interface is either physical or virtual.

Static IP address

IPv4 or IPv6 address can be added to an interface. Let’s add a static IPv4 address ‘10.0.0.1/24’ on port we name ‘giga0’:

vrouter running config# vrf main
vrouter running vrf main# interface physical giga0
vrouter running physical giga0#! port pci-b0s4
vrouter running physical giga0# ipv4 address 10.0.0.1/24

Or an IPv6 address:

vrouter running physical giga0# ipv6 address 2001:DB8:657:494E::4401/64

Check the NETCONF XML for this configuration:

vrouter running physical giga0# show config xml absolute
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <interface xmlns="urn:6wind:vrouter/interface">
      <physical>
        <name>giga0</name>
        <enabled>true</enabled>
        <ipv4>
          <enabled>true</enabled>
          <address>
            <ip>10.0.0.1/24</ip>
          </address>
        </ipv4>
        <ipv6>
          <router-advertisement>
            <suppress>false</suppress>
          </router-advertisement>
          <enabled>true</enabled>
          <dup-addr-detect-transmits>1</dup-addr-detect-transmits>
          <address>
            <ip>2001:DB8:657:494E::4401/64</ip>
          </address>
        </ipv6>
        <port>pci-b0s4</port>
      </physical>
    </interface>
  </vrf>
</config>

To show the interface in a human readable way:

vrouter running config# show interface details name giga0
2: giga0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
 link/ether de:ad:de:01:02:03 brd ff:ff:ff:ff:ff:ff
 inet 10.0.0.1/24 brd 10.0.0.255 scope global giga0
    valid_lft forever preferred_lft forever
 inet6 fec0::dcad:deff:fe01:203/64 scope site mngtmpaddr dynamic
    valid_lft 84443sec preferred_lft 12443sec
 inet6 fe80::dcad:deff:fe01:203/64 scope link
    valid_lft forever preferred_lft forever
 inet6 2001:db8:657:494e::4401/64 scope link
    valid_lft forever preferred_lft forever

DHCP for IPv4

You can use the DHCP client to dynamically obtain an IP address and other parameters such as the default gateway, DNS servers information from a DHCP server. This parameter is not available for point to point interfaces.

In this example we enable DHCP on an interface, leaving only the following options activated:

  • domain-name, used when resolving hostnames with DNS

  • ntp-servers, to get the list of NTP servers

  • interface-mtu, to get the MTU to use on this interface

vrouter running config# vrf main
vrouter running vrf main# interface physical eth0
vrouter running physical eth0#! port pci-b0s3
vrouter running physical eth0# ipv4 dhcp
vrouter running dhcp# del request subnet-mask
vrouter running dhcp# del request broacast-address
vrouter running dhcp# del request time-offset
vrouter running dhcp# del request routers
vrouter running dhcp# del request domain-search
vrouter running dhcp# del request domain-name-servers
vrouter running dhcp# del request host-name
vrouter running dhcp# del request nis-domain
vrouter running dhcp# del request nis-servers
vrouter running dhcp# commit

To check the state:

vrouter running config# show state vrf main interface physical eth0 ipv4 dhcp
dhcp
    dhcp-lease-time 7200
    select-timeout 0
    current-lease
        expire 4 2018/06/28 16:14:53
        fixed-address 10.0.2.15
        rebind 4 2018/06/28 13:14:53
        renew 4 2018/06/28 02:49:27
        ..
    retry 300
    reboot 10
    enabled true
    initial-interval 10
    timeout 60
    request domain-name
    request ntp-servers
    request interface-mtu
    ..

Check the NETCONF XML for this configuration:

vrouter running physical eth0# show config xml absolute
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <interface xmlns="urn:6wind:vrouter/interface">
      <physical>
        <name>eth0</name>
        <enabled>true</enabled>
        <ipv4>
          <enabled>true</enabled>
          <dhcp>
            <enabled>true</enabled>
            <timeout>60</timeout>
            <retry>300</retry>
            <select-timeout>0</select-timeout>
            <reboot>10</reboot>
            <initial-interval>10</initial-interval>
            <dhcp-lease-time>7200</dhcp-lease-time>
            <request>domain-name</request>
            <request>ntp-servers</request>
            <request>interface-mtu</request>
          </dhcp>
        </ipv4>
        <ipv6>
          <router-advertisement>
            <suppress>false</suppress>
          </router-advertisement>
          <enabled>true</enabled>
          <dup-addr-detect-transmits>1</dup-addr-detect-transmits>
        </ipv6>
        <port>pci-b0s3</port>
      </physical>
    </interface>
  </vrf>
</config>

Static ARP/NDP neighbour entry

Static ARP (IPv4) or NDP (IPv6) neighbour can be added to an interface. This parameter is not available for point to point interfaces.

From ‘ipv4’ context you can add static ARP entries to bind an IP address to a fixed ethernet address:

vrouter running ipv4# neighbor 10.0.0.64 link-layer-address 00:06:57:49:4e:44

Or from ‘ipv6’ context, you can add static NDP entries to bind an IPv6 address to a fixed ethernet address:

vrouter running ipv6# neighbor 2001:DB8:657:494E::4499 link-layer-address 00:06:57:49:4e:44

Check the NETCONF XML for this configuration:

vrouter running physical eth0# show config xml absolute
<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <interface xmlns="urn:6wind:vrouter/interface">
      <physical>
        <name>eth0</name>
        <enabled>true</enabled>
        <ipv4>
          <enabled>true</enabled>
          <neighbor>
            <ip>10.0.0.64</ip>
            <link-layer-address>00:06:57:49:4e:44</link-layer-address>
          </neighbor>
        </ipv4>
        <ipv6>
          <enabled>true</enabled>
          <neighbor>
            <ip>2001:DB8:657:494E::4499</ip>
            <link-layer-address>00:06:57:49:4e:44</link-layer-address>
          </neighbor>
        </ipv6>
      </physical>
    </interface>
  </vrf>
</config>