This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ipv6_opnfv_project:vm_as_router [2015/06/17 19:58] Bin Hu created |
ipv6_opnfv_project:vm_as_router [2015/10/16 06:27] (current) Bin Hu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Get a Service VM Running as a vRouter ===== | + | ===== Step 4: Option 2: Get a Service VM Running as a vRouter (SLAAC) ===== |
- | # Current network setup for IPv6 router VM on local virtualbox setup | + | # Current network setup for IPv6 router VM on local virtualbox setup\\ |
- | # /etc/sysconfig/network-scripts/ifcfg-enp0s3 | + | # /etc/sysconfig/network-scripts/ifcfg-enp0s3\\ |
- | # Network interface enp0s3 is IPv4 for public internet access | + | # Network interface enp0s3 is IPv4 for public internet access\\ |
- | TYPE="Ethernet" | + | TYPE="Ethernet"\\ |
- | BOOTPROTO="dhcp" | + | BOOTPROTO="dhcp"\\ |
- | DEFROUTE="yes" | + | DEFROUTE="yes"\\ |
- | PEERDNS="yes" | + | PEERDNS="yes"\\ |
- | PEERROUTES="yes" | + | PEERROUTES="yes"\\ |
- | IPV4_FAILURE_FATAL="no" | + | IPV4_FAILURE_FATAL="no"\\ |
- | IPV6INIT="yes" | + | IPV6INIT="yes"\\ |
- | IPV6_AUTOCONF="yes" | + | IPV6_AUTOCONF="yes"\\ |
- | IPV6_DEFROUTE="yes" | + | IPV6_DEFROUTE="yes"\\ |
- | IPV6_PEERDNS="yes" | + | IPV6_PEERDNS="yes"\\ |
- | IPV6_PEERROUTES="yes" | + | IPV6_PEERROUTES="yes"\\ |
- | IPV6_FAILURE_FATAL="no" | + | IPV6_FAILURE_FATAL="no"\\ |
- | NAME="enp0s3" | + | NAME="enp0s3"\\ |
- | UUID="32bad876-680a-4f78-a364-726eae21bfcf" | + | UUID="32bad876-680a-4f78-a364-726eae21bfcf"\\ |
- | DEVICE="enp0s3" | + | DEVICE="enp0s3"\\ |
- | ONBOOT="yes" | + | ONBOOT="yes"\\ |
- | # /etc/sysconfig/network-scripts/ifcfg-enp0s8 | + | # /etc/sysconfig/network-scripts/ifcfg-enp0s8\\ |
- | # Network interface enp0s8 is IPv6 internal interface to provide IPv6 to internal hosts | + | # Network interface enp0s8 is IPv6 internal interface to provide IPv6 to internal hosts\\ |
- | BOOTPROTO=static | + | BOOTPROTO=static\\ |
- | IPV6INIT=yes | + | IPV6INIT=yes\\ |
- | IPV6ADDR="2001:db8:0:2::1/64" | + | IPV6ADDR="2001:db8:0:2::1/64"\\ |
- | NAME=enp0s8 | + | NAME=enp0s8\\ |
- | UUID=e931a806-2f76-425d-b035-d37813b81df5 | + | UUID=e931a806-2f76-425d-b035-d37813b81df5\\ |
- | DEVICE=enp0s8 | + | DEVICE=enp0s8\\ |
- | ONBOOT=yes | + | ONBOOT=yes\\ |
- | NM_CONTROLLED=no | + | NM_CONTROLLED=no\\ |
- | # Disable NetworkManager | + | # Disable NetworkManager\\ |
- | systemctl disable NetworkManager | + | systemctl disable NetworkManager\\ |
- | # Install dhcp.x86_64, dhcp-common.x86_64, radvd.x86_64 if not already installed | + | # Install dhcp.x86_64, dhcp-common.x86_64, radvd.x86_64 if not already installed\\ |
- | yum install dhcp-common | + | yum install dhcp-common\\ |
- | yum install dhcp | + | yum install dhcp\\ |
- | yum install radvd | + | yum install radvd\\ |
- | # /etc/sysctl.conf Set sysctl to enable IPv6 forwarding | + | # /etc/sysctl.conf Set sysctl to enable IPv6 forwarding\\ |
- | net.ipv6.conf.all.forwarding=1 | + | net.ipv6.conf.all.forwarding=1\\ |
- | net.ipv6.conf.enp0s8.accept_ra=2 | + | net.ipv6.conf.enp0s3.accept_ra=2\\ |
- | net.ipv6.conf.enp0s8.accept_ra_defrtr=1 | + | net.ipv6.conf.enp0s3.accept_ra_defrtr=1\\ |
- | net.ipv6.conf.enp0s8.router_solicitations=1 | + | net.ipv6.conf.enp0s3.router_solicitations=1\\ |
- | # /etc/dhcpd/dhcpd6.conf | + | # /etc/radvd.conf\\ |
- | # DHCP for IPv6 Server Configuration file. | + | interface enp0s8\\ |
+ | {\\ | ||
+ | # This is the primary "on switch" for RADVD | ||
+ | AdvSendAdvert on; | ||
+ | #\\ | ||
+ | # These settings determine how often advertisements will be sent every X-Y.\\ | ||
+ | # X and Y are in seconds. With these settings you will be sending a advert every 60 seconds\\ | ||
+ | #\\ | ||
- | # Enable RFC 5007 support (same than for DHCPv4) | + | MinRtrAdvInterval 60; |
- | allow leasequery; | + | MaxRtrAdvInterval 180; |
- | # IPv6 address valid lifetime | + | #\\ |
- | # (at the end the address is no longer usable by the client) | + | # Disable Mobile IPv6 support\\ |
- | # (set to 30 days, the usual IPv6 default) | + | #\\ |
- | default-lease-time 2592000; | + | AdvHomeAgentFlag off; |
- | # IPv6 address preferred lifetime | + | # Here we set our managed flags\\ |
- | # (at the end the address is deprecated, i.e., the client should use | + | |
- | # other addresses for new connections) | + | |
- | # (set to 7 days, the usual IPv6 default) | + | |
- | preferred-lifetime 604800; | + | |
- | # T1, the delay before Renew | + | AdvManagedFlag on; |
- | # (default is 1/2 preferred lifetime) | + | AdvOtherConfigFlag on; |
- | # (set to 1 hour) | + | |
- | option dhcp-renewal-time 3600; | + | |
- | # T2, the delay before Rebind (if Renews failed) | + | #\\ |
- | # (default is 3/4 preferred lifetime) | + | # Enter our IPv6 prefix and CIDR\\ |
- | # (set to 2 hours) | + | #\\ |
- | option dhcp-rebinding-time 7200; | + | prefix 2001:db8:0:2::/64 |
+ | { | ||
+ | AdvOnLink on; | ||
+ | ### On link tells the host that the default router is on the same "link" as it is | ||
+ | AdvAutonomous on; | ||
+ | AdvRouterAddr off; | ||
+ | }; | ||
- | # The path of the lease file | + | };\\ |
- | dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases"; | + | |
- | # Set preference to 255 (maximum) in order to avoid waiting for | + | # Enable radvd service\\ |
- | # additional servers when there is only one | + | systemctl enable radvd\\ |
- | option dhcp6.preference 255; | + | |
- | # Server side command to enable rapid-commit (2 packet exchange) | + | # In /etc/sysconfig/network add\\ |
- | option dhcp6.rapid-commit; | + | IPV6FORWARDING=yes\\ |
- | # The delay before information-request refresh | + | ===== Step 4: Option 2: Get a Service VM Running as a vRouter (DHCPv6 Stateful Server) ===== |
- | # (minimum is 10 minutes, maximum one day, default is to not refresh) | + | |
- | # (set to 6 hours) | + | |
- | option dhcp6.info-refresh-time 21600; | + | |
- | # Set this to `interim' when doing ddns updates | + | # Current network setup for IPv6 router VM on local virtualbox setup\\ |
- | ddns-update-style interim; | + | # /etc/sysconfig/network-scripts/ifcfg-enp0s3\\ |
+ | # Network interface enp0s3 is IPv4 for public internet access\\ | ||
+ | TYPE="Ethernet"\\ | ||
+ | BOOTPROTO="dhcp"\\ | ||
+ | DEFROUTE="yes"\\ | ||
+ | PEERDNS="yes"\\ | ||
+ | PEERROUTES="yes"\\ | ||
+ | IPV4_FAILURE_FATAL="no"\\ | ||
+ | IPV6INIT="yes"\\ | ||
+ | IPV6_AUTOCONF="yes"\\ | ||
+ | IPV6_DEFROUTE="yes"\\ | ||
+ | IPV6_PEERDNS="yes"\\ | ||
+ | IPV6_PEERROUTES="yes"\\ | ||
+ | IPV6_FAILURE_FATAL="no"\\ | ||
+ | NAME="enp0s3"\\ | ||
+ | UUID="32bad876-680a-4f78-a364-726eae21bfcf"\\ | ||
+ | DEVICE="enp0s3"\\ | ||
+ | ONBOOT="yes"\\ | ||
- | subnet6 2001:db8:0:2::/64 { | + | # /etc/sysconfig/network-scripts/ifcfg-enp0s8\\ |
- | # Our address range eeff through ffff | + | # Network interface enp0s8 is IPv6 internal interface to provide IPv6 to internal hosts\\ |
- | range6 | + | BOOTPROTO=static\\ |
- | 2001:db8:0:2::1000 | + | IPV6INIT=yes\\ |
- | 2001:db8:0:2::1fff; | + | IPV6ADDR="2001:db8:0:2::1/64"\\ |
- | option dhcp6.name-servers 2001:db8:0:2::1; | + | NAME=enp0s8\\ |
- | option dhcp6.domain-search "opnfv.local"; | + | UUID=e931a806-2f76-425d-b035-d37813b81df5\\ |
- | ddns-hostname = concat(binary-to-ascii(10, 8, "-", leased-address), ".wired"); | + | DEVICE=enp0s8\\ |
- | ddns-domainname = "opnfv.local"; | + | ONBOOT=yes\\ |
- | } | + | NM_CONTROLLED=no\\ |
+ | # Disable NetworkManager\\ | ||
+ | systemctl disable NetworkManager\\ | ||
- | # /etc/radvd.conf | + | # Install dhcp.x86_64, dhcp-common.x86_64, radvd.x86_64 if not already installed\\ |
- | interface enp0s8 | + | yum install dhcp-common\\ |
- | { | + | yum install dhcp\\ |
- | AdvSendAdvert on; | + | yum install radvd\\ |
- | ### This is the primary "on switch" for RADVd | + | |
- | # | + | # /etc/sysctl.conf Set sysctl to enable IPv6 forwarding\\ |
- | # These settings determine how offten advertisements will be sent every X-Y. | + | net.ipv6.conf.all.forwarding=1\\ |
- | # X and Y are in seconds. With these settings you will be sending a advert every 60 seconds | + | net.ipv6.conf.enp0s3.accept_ra=2\\ |
- | # | + | net.ipv6.conf.enp0s3.accept_ra_defrtr=1\\ |
+ | net.ipv6.conf.enp0s3.router_solicitations=1\\ | ||
- | MinRtrAdvInterval 60; | + | # /etc/dhcp/dhcpd6.conf\\ |
- | MaxRtrAdvInterval 180; | + | # DHCP for IPv6 Server Configuration file. |
- | # | + | # Enable RFC 5007 support (same than for DHCPv4)\\ |
- | # Disable Mobile IPv6 support | + | allow leasequery; |
- | # | + | |
- | AdvHomeAgentFlag off; | + | |
- | # Here we set our managed flags | + | # IPv6 address valid lifetime\\ |
+ | # (at the end the address is no longer usable by the client)\\ | ||
+ | # (set to 30 days, the usual IPv6 default)\\ | ||
+ | default-lease-time 2592000; | ||
- | AdvManagedFlag on; | + | # IPv6 address preferred lifetime\\ |
- | AdvOtherConfigFlag on; | + | # (at the end the address is deprecated, i.e., the client should use\\ |
+ | # other addresses for new connections)\\ | ||
+ | # (set to 7 days, the usual IPv6 default)\\ | ||
+ | preferred-lifetime 604800; | ||
- | # | + | # T1, the delay before Renew\\ |
- | # Enter our IPv6 prefix and CIDR | + | # (default is 1/2 preferred lifetime)\\ |
- | # | + | # (set to 1 hour)\\ |
- | prefix 2001:db8:0:2::/64 | + | option dhcp-renewal-time 3600; |
- | { | + | |
- | AdvOnLink on; | + | |
- | ### On link tells the host that the default router is on the same "link" as it is | + | |
- | AdvAutonomous on; | + | |
- | AdvRouterAddr off; | + | |
- | }; | + | |
- | }; | + | # T2, the delay before Rebind (if Renews failed)\\ |
+ | # (default is 3/4 preferred lifetime)\\ | ||
+ | # (set to 2 hours)\\ | ||
+ | option dhcp-rebinding-time 7200; | ||
+ | |||
+ | # The path of the lease file\\ | ||
+ | dhcpv6-lease-file-name "/var/lib/dhcpd/dhcpd6.leases"; | ||
+ | |||
+ | # Set preference to 255 (maximum) in order to avoid waiting for\\ | ||
+ | # additional servers when there is only one\\ | ||
+ | option dhcp6.preference 255; | ||
+ | |||
+ | # Server side command to enable rapid-commit (2 packet exchange)\\ | ||
+ | option dhcp6.rapid-commit; | ||
+ | |||
+ | # The delay before information-request refresh\\ | ||
+ | # (minimum is 10 minutes, maximum one day, default is to not refresh)\\ | ||
+ | # (set to 6 hours)\\ | ||
+ | option dhcp6.info-refresh-time 21600; | ||
+ | |||
+ | # Set this to `interim' when doing ddns updates\\ | ||
+ | ddns-update-style interim; | ||
+ | |||
+ | subnet6 2001:db8:0:2::/64 { | ||
+ | option dhcp6.name-servers 2001:db8:0:2::1; | ||
+ | option dhcp6.domain-search "opnfv.local"; | ||
+ | ddns-hostname = concat(binary-to-ascii(10, 8, "-", leased-address), ".wired"); | ||
+ | ddns-domainname = "opnfv.local"; | ||
+ | # Our address range 1000 through 1fff | ||
+ | range6 2001:db8:0:2::1000 2001:db8:0:2::1fff; | ||
+ | } | ||
- | # Enable dhcpd6 and radvd service | ||
- | systemctl enable dhcpd6.service | ||
- | systemctl enable radvd | ||
+ | # In /etc/sysconfig/network add\\ | ||
+ | IPV6FORWARDING=yes\\ | ||
+ | For reference "How to set up RADVd DHCPv6 and DNS on CentOS 6" refer | ||
+ | [[http://www.percula.info/archives/196]] |