User Tools

Site Tools


wiki:set_up_ipv6_host_vm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:set_up_ipv6_host_vm [2025/10/09 12:05] – created antisawiki:set_up_ipv6_host_vm [2025/10/09 12:21] (current) – [See also] add Add additional ip address on interface antisa
Line 3: Line 3:
 ====== Set up IPv6 on host and VM ====== ====== Set up IPv6 on host and VM ======
  
 +Prerequisites:
  
 +  - host with ipv6 subnet assigned
 +  - kvm/qemu virtal machines
  
-Prerequisites: +===== Host machine =====
- - host with ipv6 subnet assigned +
- - kvm/qemu virtal machines+
  
 Identify the interface to which to assign the ipv6. In case you are using a bridge you need to use the bridge interface. Identify the interface to which to assign the ipv6. In case you are using a bridge you need to use the bridge interface.
  
-Set up bridge+Set up bridge (install ''bridge-utils'' package)
   brctl addbr br0   brctl addbr br0
   ip link set up dev br0   ip link set up dev br0
Line 35: Line 36:
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
-If you just want to use the v6 address on the interface itself you have to remove it from the bridge if you want to use it.+If you just want to use the v6 address on the interface itself you have to remove it from the bridge.
 </WRAP> </WRAP>
  
 We add the IP: We add the IP:
   ip -6 addr add 2607:5300:203:9cc9::/64 dev br0   ip -6 addr add 2607:5300:203:9cc9::/64 dev br0
-This is subnet so you can choose an ip like 2607:5300:203:9cc9::1234.+This is subnet so you can choose an ip like 2607:5300:203:9cc9::1234. In this example the above is equal to ''2607:5300:203:9cc9::0'' IP address.
  
-Add route to the v6 gateway itself+Add route to the v6 gateway itself (get it from the server provider)
   ip -6 route add 2607:5300:0203:9cff:00ff:00ff:00ff:00ff dev br0   ip -6 route add 2607:5300:0203:9cff:00ff:00ff:00ff:00ff dev br0
  
Line 49: Line 50:
  
 Check Check
-</code>+<code>
 # ip -6 r # ip -6 r
 ::1 dev lo proto kernel metric 256 pref medium ::1 dev lo proto kernel metric 256 pref medium
Line 68: Line 69:
 ===== Inside of VM ===== ===== Inside of VM =====
  
-assign an ip from the IPv6 subnet of the host:+Assign an ip from the IPv6 subnet of the host. We chose ..:178 here:
 <code> <code>
-[root@zz1 ~]# ip -6 addr add 2607:5300:203:9cc9::178/64 dev eth0                                                                                      13:29:06 [40/277] +# ip -6 addr add 2607:5300:203:9cc9::178/64 dev eth0                                                                                       
-[root@zz1 ~]# ip a                                +# ip a                                
 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00                                                                                                                   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00                                                                                                              
Line 87: Line 88:
     inet6 fe80::ff:fea0:b6a8/64 scope link                        inet6 fe80::ff:fea0:b6a8/64 scope link                   
        valid_lft forever preferred_lft forever        valid_lft forever preferred_lft forever
 +</code>
 +
 +Now add default route. "via" is the IPv6 of the host interface br0.
 +<code>
 +# ip -6 route add default via 2607:5300:203:9cc9::0
  
-Now add default route  +# ping6 2001:4860:4860::8888                                                        
-[root@zz1 ~]# ip -6 route add default via 2607:5300:203:9cc9::+
-[root@zz1 ~]# ping6 2001:4860:4860::8888                                                        +
 PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 data bytes
 64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=113 time=1.24 ms 64 bytes from 2001:4860:4860::8888: icmp_seq=2 ttl=113 time=1.24 ms
Line 96: Line 100:
 64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=113 time=1.25 ms                                                                                                     64 bytes from 2001:4860:4860::8888: icmp_seq=4 ttl=113 time=1.25 ms                                                                                                    
 64 bytes from 2001:4860:4860::8888: icmp_seq=5 ttl=113 time=1.25 ms 64 bytes from 2001:4860:4860::8888: icmp_seq=5 ttl=113 time=1.25 ms
 +</code>
  
-via is the IPv6 of the host interface br0+If any of the pings aren't working make sure to check if the firewall is blocking and you have ipv6 forwarding enabled on host.
  
 ====== Tested on ====== ====== Tested on ======
-  * +  * AlmaLinux 9 
 +  * KVM/Qemu VMs
  
 ====== See also ====== ====== See also ======
 +  * [[add_additional_ip_address_interface|Add additional ip address on interface]]
 ====== References ====== ====== References ======
 +  * https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf 
 +  * [[https://tools.keycdn.com/ipv6-ping|Ping6 test website]]
  
wiki/set_up_ipv6_host_vm.1760011514.txt.gz · Last modified: by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki