Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Specific IP address use
PostPosted: Sun Jul 03, 2011 6:48 am 
Offline
Senior Newbie

Joined: Sat Jul 02, 2011 1:11 am
Posts: 13
Sorry for asking so much from you guys, but I can find almost zero on the internet about what I'm attempting to do.

I converted my linode over to IPv6 a little while ago and recieved a pool of 4096 addresses from linode as well. I have added a few of these addresses to my linode using the guide shown, but I have some questions for ways to use them.

What I really want to do is select which IP to use as my main IP. I currently have three IPv6 addresses on eth0 on my Arch Linux linode. Is there a way that I could, for example, run Firefox using IP 1, close it, then run Firefox using IP 2? Like, http://seemyip.com IP.

If you still don't understand what I'm asking, I'm basically trying to swap the IP my linode uses as it's main external IP for a different one.


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 7:25 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
Yes, there's one or two ways to set the system-wide default IPv6 source address, of varying levels of evil. Individual applications may also support setting the source address for connections they make.

The system-wide method I use is marking certain addresses as deprecated. For example, here's a snippet of how eth0 is configured on my Ubuntu node -- "preferred_lft 0" is the important part:

Code:
auto eth0
iface eth0 inet static
    address 67.18.187.111
    gateway 67.18.187.1
    netmask 255.255.255.0
    up ip addr add 192.168.130.4/17 dev eth0
    down ip addr del 192.168.130.4/17 dev eth0
    up ip addr add 2600:3c00::2:b001/64 dev eth0
    down ip addr del 2600:3c00::2:b001/64 dev eth0
    up ip addr add 2600:3c00::2:b101/64 dev eth0 preferred_lft 0
    down ip addr del 2600:3c00::2:b101/64 dev eth0
    up ip addr add 2600:3c00::2:b401/64 dev eth0 preferred_lft 0
    down ip addr del 2600:3c00::2:b401/64 dev eth0


N.B.: I don't mark the autoconfigured EUI-64 address (i.e. 2600:3c00::f03c:91ff:fe96:6bcc in my case) as deprecated. It shouldn't ever get used as the default source address anyway, since it's added before my other addresses, but I don't mind if it does, so I make no effort to prevent it. If I wanted to do so, something like this would work:

Code:
    up ip addr change 2600:3c00::f03c:91ff:fe96:6bcc dev eth0 preferred_lft 0


I'm sure Arch has a different style of networking configuration, but this should give you an idea -- and it's always possible to stick iproute2 commands *somewhere*.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 8:40 am 
Offline
Senior Member

Joined: Fri Dec 10, 2010 6:21 am
Posts: 144
Wouldn't it be a more "appropriate" way of doing this to, for ipv4 and ipv6 alike, use the policy routing facilities? (Also set up through the ip command)


(Or am I way off track now?)


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 12:05 pm 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
hawk7000 wrote:
Wouldn't it be a more "appropriate" way of doing this to, for ipv4 and ipv6 alike, use the policy routing facilities? (Also set up through the ip command)


(Or am I way off track now?)

Probably, but I didn't know about that when I first set it up, and I still haven't read up on how to do it. And I think my iproute2 is too old anyway.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 12:33 pm 
Offline
Senior Newbie

Joined: Sat Jul 02, 2011 1:11 am
Posts: 13
mnordhoff, I tried your article and it seems like it would work fine on arch linux but I'm having issues with it. My external IP address is not changing no matter which ones I deprecate, and I can still connect even if I deprecate them all.

Code:
[root@li224-139 squid]# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host deprecated
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2600:3c01::1b:6ffd/64 scope global
       valid_lft forever preferred_lft forever
    inet6 2600:3c01::1b:6fff/64 scope global deprecated
       valid_lft forever preferred_lft forever
    inet6 2600:3c01::f03c:91ff:fe93:b047/64 scope global deprecated
       valid_lft forever preferred_lft forever
    inet6 fe80::f03c:91ff:fe93:b047/64 scope link deprecated
       valid_lft forever preferred_lft forever
[root@li224-139 squid]# lynx -dump 'http://seemyip.com'|grep "What is my IP?"
               What is my IP? 173.255.214.139([2]ARIN Lookup)
[root@li224-139 squid]# ip -6 addr change  2600:3c01::1b:6ffd/64 dev eth0 preferred_lft 0
[root@li224-139 squid]# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
    inet6 ::1/128 scope host deprecated
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
    inet6 2600:3c01::1b:6ffd/64 scope global deprecated
       valid_lft forever preferred_lft forever
    inet6 2600:3c01::1b:6fff/64 scope global deprecated
       valid_lft forever preferred_lft forever
    inet6 2600:3c01::f03c:91ff:fe93:b047/64 scope global deprecated
       valid_lft forever preferred_lft forever
    inet6 fe80::f03c:91ff:fe93:b047/64 scope link deprecated
       valid_lft forever preferred_lft forever
[root@li224-139 squid]# lynx -dump 'http://seemyip.com'|grep "What is my IP?"
               What is my IP? 173.255.214.139([2]ARIN Lookup)


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 1:29 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Your lynx connection is using IPv4. "seemyip.com" doesn't have an IPv6 address so you can't use it for this test.

Try
Code:
 lynx --dump http://www.whatismyipv6.net/ | grep 'Your IP'

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 2:04 pm 
Offline
Senior Newbie

Joined: Sat Jul 02, 2011 1:11 am
Posts: 13
sweh wrote:
Your lynx connection is using IPv4. "seemyip.com" doesn't have an IPv6 address so you can't use it for this test.

Try
Code:
 lynx --dump http://www.whatismyipv6.net/ | grep 'Your IP'

So if you check my IP using IPv4 no matter what IPv6 address I'm using it'll return the same IP?


Top
   
 Post subject:
PostPosted: Sun Jul 03, 2011 2:07 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
IPv4 and IPv6 are two totally different systems. Messing around with IPv6 addresses does not change your IPv4 address.

Unless you pay for extra, you only have one IPv4 address and all IPv4 connections you make will use that address. No matter what you do with IPv6.

_________________
Rgds

Stephen

(Linux user since kernel version 0.11)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group