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’:

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

Or an IPv6 address:

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

Check the NETCONF XML for this configuration:

vsr 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:

vsr 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 promiscuity 0 minmtu 68 maxmtu 65535 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
 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

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

To check the state:

vsr 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:

vsr 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>

DHCP for IPv6

You can use the DHCPv6 client to dynamically obtain an IP address and other parameters such as the default gateway, DNS servers information from a DHCPv6 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

vsr running config# vrf main
vsr running vrf main# interface physical eth0
vsr running physical eth0#! port pci-b0s3
vsr running physical eth0# ipv6 dhcp
vsr running dhcp# commit

To check the state:

vsr running config# show state vrf main interface physical eth0 ipv6 dhcp
dhcp
    enabled true
    timeout 60
    retry 300
    select-timeout 0
    reboot 10
    initial-interval 10
    prefix-delegation false
    current-lease
        ia-address fd00:100::f449
        renew 0
        rebind 0
        starts 1721238171
        preferred-lifetime 2250
        max-lifetime 3600
        ..
    request sntp-servers
    request domain-search
    request name-servers
    ..

Check the NETCONF XML for this configuration:

 vsr 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>
         <ipv4>
           <enabled>true</enabled>
         </ipv4>
         <enabled>true</enabled>
         <ddos-protection/>
         <port>pci-b0s3</port>
         <ipv6>
           <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>
             <prefix-delegation>false</prefix-delegation>
             <request>sntp-servers</request>
             <request>domain-search</request>
             <request>name-servers</request>
           </dhcp>
         </ipv6>
         <network-stack>
           <ipv4/>
           <ipv6>
             <accept-router-advert>always</accept-router-advert>
             <router-solicitations>-1</router-solicitations>
           </ipv6>
         </network-stack>
         <ethernet/>
       </physical>
     </interface>
   </vrf>
</config>

IPv6 prefix delegation

You can use the DHCPv6 client to dynamically retrieve IPv6 prefixes from an interface. These prefixes can then be used to advertise on another interface with ipv6-autoconf.

In this example we will enable prefix delegation on the interface eth1:

vsr running config# vrf main interface physical eth1 ipv6 dhcp
vsr running dhcp# enable true
vsr running dhcp# prefix-delegation true
vsr running dhcp# commit

Check the NETCONF XML for this configuration:

<config xmlns="urn:6wind:vrouter">
  <vrf>
    <name>main</name>
    <interface xmlns="urn:6wind:vrouter/interface">
      <physical>
        <name>eth1</name>
        <ipv4>
          <enabled>true</enabled>
        </ipv4>
        <enabled>true</enabled>
        <port>pci-b0s4</port>
        <ipv6>
          <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>
            <prefix-delegation>true</prefix-delegation>
            <request>domain-search</request>
            <request>name-servers</request>
          </dhcp>
        </ipv6>
        <network-stack>
          <ipv6>
            <accept-router-advert>always</accept-router-advert>
            <router-solicitations>-1</router-solicitations>
          </ipv6>
        </network-stack>
      </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:

vsr 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:

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

Check the NETCONF XML for this configuration:

vsr 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>