LinuxQuestions.org
Help answer threads with 0 replies.
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 10-14-2012, 01:24 PM   #1
Pearlseattle
Senior Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 1,001

Rep: Reputation: 142Reputation: 142
Root server & 2 VMs: best setup for IPv4 and IPv6 connections?


Hi
It's since a while that I'm fiddling around with the network setup of my server and am not sure which solution would be the best & simpliest one.

Situation:
  • Root server, with 1 public IPv4 address and a lot of public IPv6 addresses available.
  • Running on the server 2 VMs.
  • VM1 runs the Apache webserver
  • VM2 runs the mailserver
Final target:
Would like to have both external IPv4 and IPv6-requests ending up into the right VM.

What I did so far:
1)
This was simple: I used KVM's port-forwarding functionality to forward all incoming requests on a specific port (e.g. port 80 for http) to the correct VM (e.g. VM1 for http/port 80 requests).
Example:
Code:
KVM_CMD="qemu-kvm \
        -nographic -daemonize \
        -balloon none \
        -pidfile $PIDPATH \
        -drive file=/mnt/vm/images/amd64-gentoo-main/rootfs.img,if=virtio,cache=writeback \
        -drive file=/mnt/vm/images/amd64-gentoo-main/swapfile.img,if=virtio,cache=writeback \
        -m 3072 -smp 3 \
        -kernel /boot/current-kernel \
        -append \"root=/dev/vda\" \
        -net nic,model=virtio,macaddr=DE:AD:BE:EF:29:10 \
        -net user,host=192.168.1.2,restrict=n,net=192.168.1.0/24,\
hostfwd=tcp::80-:80"
Unluckily this mechanism does not handle IPv6

2)
I am now thinking about a network bridge (br0 and tap1/2/3...). I could create one (tried yesterday and it worked - had a tap-devices available to be used) and using that I could set in every single VM one of the many external IPv6-addresses, but because I don't have more than 1 external IPv4-addresses I think that I'll have to set up iptables on the host to forward incoming IPv4-requests to the correct VM depending on the port.

I'm not sure if option 2 is actually valid - it's good that I can decide from within the VM which external IPv6-address I want to use (or at least I think so), but IPv4 won't work because I don't have any additional IPv4-address (the only one I have is used by the host itself) => I might have to create a virtual NIC on the host that points to an internal network (e.g. 10.0.0.1) and give to the VMs that kind of address (e.g. 10.0.0.10 to VM1 and 10.0.0.20 to VM2).
Not sure if what I write is makes sense...

[EDIT-START]
And if I use option 2 and create a bridge on an internal virtual network, probably the IPv6 from within the VMs won't be able to reach the outer network/Internet?
Getting very confused... .
[EDIT-END]

All this sounds quite complicated... .
Am I making things too complicated? Any simplier solution for this kind of setup?
Thanks a lot.

Last edited by Pearlseattle; 10-14-2012 at 05:32 PM.
 
  


Reply


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
pdnsd for both ipv4 and ipv6 on the same server systemlordanubis Linux - Networking 1 11-20-2012 05:36 PM
libnetfilter_conntrack with IPv4 & IPv6 Washington Ratso Programming 0 07-07-2011 05:04 PM
how do i add IPv6 to my IPv4 server? steve51184 Linux - Networking 8 02-17-2011 04:08 PM
Need to get IPV4 instead of IPV6 on a SuSe Enterprise Server ikw38 Linux - Networking 1 04-30-2006 03:41 PM

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

All times are GMT -5. The time now is 07:35 AM.

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