LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2016, 01:51 PM   #1
wered
LQ Newbie
 
Registered: May 2010
Location: Va
Distribution: Linux Mint/Ubuntu Server
Posts: 9

Rep: Reputation: 0
Question Static IPv6 Not working on ubuntu


I am currently running Ubuntu 16.04 on Hyper-V, and im trying to assign a public IPv6 Address, but it wont seem to use the one being assigned to it. The address shows in ifconfig, however the IP that was assigned to it cannot be pinged by itself or by another machine on the network and when trying to ping any IPv6 addresses on the lan even if they are on the same public subnet assigned to them it it will use the fe80 address that Ubuntu auto assigns to it. How would i go about fixing that?

eth0 Link encap:Ethernet HWaddr 00:15:5d:38:01:1a
inet addr:100.XXX.XXX.XXX Bcast:100.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::215:5dff:fe38:11a/64 Scope:Link
inet6 addr: 2001:470:8:7bd::6/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:291000 errors:0 dropped:0 overruns:0 frame:0
TX packets:349504 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:104045860 (104.0 MB) TX bytes:62259271 (62.2 MB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:920029 errors:0 dropped:0 overruns:0 frame:0
TX packets:920029 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:110814151 (110.8 MB) TX bytes:110814151 (110.8 MB)

/etc/network/interfaces
iface eth0 inet static
address 100.XXX.XXX.XXX
netmask 255.0.0.0
gateway 100.0.0.1
dns-nameservers 8.8.4.4
#IPv6 config
iface eth0 inet6 static
address 2001:470:8:7bd::6
gateway 2001:470:8:7bd::1
netmask 64
 
Old 07-12-2016, 08:48 PM   #2
jnihil
Member
 
Registered: Dec 2012
Location: inside the matrix
Distribution: Debian, Xubuntu, Gentoo, Antergos
Posts: 90

Rep: Reputation: 27
Try this:
Quote:
ping6 -I 2001:470:8:7bd::6 2001:470:8:7bd::1
 
Old 07-13-2016, 09:36 AM   #3
wered
LQ Newbie
 
Registered: May 2010
Location: Va
Distribution: Linux Mint/Ubuntu Server
Posts: 9

Original Poster
Rep: Reputation: 0
When doing that i get the results below.

ping6 -I 2001:470:8:7bd::6
2001:470:8:7bd::1
ping: bind icmp socket: Cannot assign requested address
 
Old 07-13-2016, 11:36 PM   #4
jnihil
Member
 
Registered: Dec 2012
Location: inside the matrix
Distribution: Debian, Xubuntu, Gentoo, Antergos
Posts: 90

Rep: Reputation: 27
Quote:
When doing that i get the results below.

ping6 -I 2001:470:8:7bd::6 2001:470:8:7bd::1
ping: bind icmp socket: Cannot assign requested address
I think that message implies that you have no such ipv6 interface. Check using ip addr command.

I used your config and under ubuntu 16.04 works fine. The following is what I did:

Check my local interface. No ipv6 address assigned:

Code:
ubuntu:~/Desktop$ ip a sh enp0s3
2: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether 08:00:27:b0:c3:e3 brd ff:ff:ff:ff:ff:ff
Then dump the interface configuration in /etc/network/interface:

Code:
ubuntu:~/Desktop$ ifquery enp0s3
address: 2001:470:8:7bd::6
gateway: 2001:470:8:7bd::1
netmask: 64
autoconf: 0
preferred-lifetime: 
dad-attempts: 60
dad-interval: 0.1
accept_ra: 0
Bring up the interface with the new ipv6 config:

Code:
ubuntu:~/Desktop$ sudo ifup enp0s3
Waiting for DAD... Done
Verify the interface address:

Code:
ubuntu:~/Desktop$ ip a sh enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:b0:c3:e3 brd ff:ff:ff:ff:ff:ff
    inet6 2001:470:8:7bd::6/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:feb0:c3e3/64 scope link 
       valid_lft forever preferred_lft forever
ping6 a local machine using a specific local ipv6 source address:

Code:
ubuntu:~/Desktop$ ping6 -I 2001:470:8:7bd::6 2001:470:8:7bd::8
PING 2001:470:8:7bd::8(2001:470:8:7bd::8) from 2001:470:8:7bd::6 : 56 data bytes
64 bytes from 2001:470:8:7bd::8: icmp_seq=1 ttl=64 time=0.589 ms
64 bytes from 2001:470:8:7bd::8: icmp_seq=2 ttl=64 time=0.249 ms
64 bytes from 2001:470:8:7bd::8: icmp_seq=3 ttl=64 time=0.238 ms
^C
--- 2001:470:8:7bd::8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.238/0.358/0.589/0.164 ms
Not sure what your problem is. Perhaps what I did above might be of some use to you.
 
  


Reply

Tags
ipv6, netwoking, ubuntu 16.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd for ipv6 still not working on ubuntu renuaseri Ubuntu 6 01-02-2015 06:37 AM
How to set IPv6 static route lebanks123! Linux - Networking 1 11-04-2014 03:27 PM
getting a static ipv6 address for iptables ACCEPT? sneakyimp Linux - Networking 6 01-04-2013 04:02 PM
Can't assign a static IPv6 address guzo Linux - Networking 0 02-11-2005 07:22 AM
How do you set up a static IPv4-in-IPv6 tunnel? daveman Linux - Networking 1 11-16-2004 03:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration