Re: vmd: routing problem

2017-07-25 Thread R0me0 ***
Hetzner routes additional subnets through a specified mac address on robots
page. ( Some cases you need to open a trouble ticket )
Also, all related information is provided there.

Cheers,

2017-07-25 10:26 GMT-03:00 Stuart Henderson :

> On 2017-07-20, Mike Larkin  wrote:
> > On Thu, Jul 20, 2017 at 02:19:29PM +0200, Leo Unglaub wrote:
> >> Hey,
> >>
> >> On 07/20/17 13:05, Mischa Peters wrote:
> >> > Can you ask them how they route the separate subnet to you?
> >>
> >> as far as i understand it they route the subnet on my main ip address.
> >>
> >>
> >> From there documentation:
> >> > Newly assigned IPv4 subnets are statically routed on the main IP
> address of the server, so no gateway is required.
> >>
> >> I hope that answers your question.
> >> Thanks and greetings
> >> Leo
> >
> >
> > Like I said before, I'm not a networking expert, but what you've said
> there
> > doesn't make sense (at least to me). You'll probably need to explain to
> them
> > what you are trying to do and have them help you. I don't think this is
> a vmd
> > related network issue.
>
> It's a common setup at large-scale colo hosts to conserve IP addresses
> while
> still keeping each customer on their own L2 network. Given a gateway
> address
> of 192.0.2.1 you should be able to use something like this:
>
> route add -inet 192.0.2.1/32 -link -iface em0
> route add -inet default 192.0.2.1
>
> To run these commands automatically at boot, you can prefix the lines
> with ! and add them to hostname.em0.
>
>
>


Re: vmd: routing problem

2017-07-25 Thread Stuart Henderson
On 2017-07-20, Mike Larkin  wrote:
> On Thu, Jul 20, 2017 at 02:19:29PM +0200, Leo Unglaub wrote:
>> Hey,
>> 
>> On 07/20/17 13:05, Mischa Peters wrote:
>> > Can you ask them how they route the separate subnet to you?
>> 
>> as far as i understand it they route the subnet on my main ip address.
>> 
>> 
>> From there documentation:
>> > Newly assigned IPv4 subnets are statically routed on the main IP address 
>> > of the server, so no gateway is required.
>> 
>> I hope that answers your question.
>> Thanks and greetings
>> Leo
>
>
> Like I said before, I'm not a networking expert, but what you've said there
> doesn't make sense (at least to me). You'll probably need to explain to them
> what you are trying to do and have them help you. I don't think this is a vmd
> related network issue.

It's a common setup at large-scale colo hosts to conserve IP addresses while
still keeping each customer on their own L2 network. Given a gateway address
of 192.0.2.1 you should be able to use something like this:

route add -inet 192.0.2.1/32 -link -iface em0   
 
route add -inet default 192.0.2.1   
  

To run these commands automatically at boot, you can prefix the lines
with ! and add them to hostname.em0.




Re: vmd: routing problem

2017-07-20 Thread Mike Larkin
On Thu, Jul 20, 2017 at 02:19:29PM +0200, Leo Unglaub wrote:
> Hey,
> 
> On 07/20/17 13:05, Mischa Peters wrote:
> > Can you ask them how they route the separate subnet to you?
> 
> as far as i understand it they route the subnet on my main ip address.
> 
> 
> From there documentation:
> > Newly assigned IPv4 subnets are statically routed on the main IP address of 
> > the server, so no gateway is required.
> 
> I hope that answers your question.
> Thanks and greetings
> Leo


Like I said before, I'm not a networking expert, but what you've said there
doesn't make sense (at least to me). You'll probably need to explain to them
what you are trying to do and have them help you. I don't think this is a vmd
related network issue.

-ml



Re: vmd: routing problem

2017-07-20 Thread Denis Fondras
> What would be the difference to your version where i use vether instead of
> an alias? Or did i missunderstand you?
> 

The difference is broadcast trafic won't be sent over your provider network.



Re: vmd: routing problem

2017-07-20 Thread Leo Unglaub

Hey,

On 07/20/17 09:46, Denis Fondras wrote:

Can you people see something that i might missed?

The easy way would be enable forwarding, add a vether(4) on the host, bridge it
with tap0 and configure it with an IP in the 136.243.186.160/29 subnet. Use that
IP as the gateway in your VMs.


i did a try where i did the following:

1: I enabled forwarding.
2: I added one IP from the 136.243.186.160/29 subnet as an alias to the 
main interface of the host

3: I added the main interface em0 and the by vmd created tap0 to a bridge0
4: I tryed to assign the same IP as the alias on em0 to the virtual machine.

What would be the difference to your version where i use vether instead 
of an alias? Or did i missunderstand you?


Thanks and greetings
Leo



Re: vmd: routing problem

2017-07-20 Thread Leo Unglaub

Hey,

On 07/20/17 13:05, Mischa Peters wrote:

Can you ask them how they route the separate subnet to you?


as far as i understand it they route the subnet on my main ip address.


From there documentation:

Newly assigned IPv4 subnets are statically routed on the main IP address of the 
server, so no gateway is required.


I hope that answers your question.
Thanks and greetings
Leo



Re: vmd: routing problem

2017-07-20 Thread Mischa Peters
Hi Leo,

Can you ask them how they route the separate subnet to you?

Mischa

> On 20 Jul 2017, at 12:59, Leo Unglaub  wrote:
> 
> Hey,
> 
>> On 07/20/17 06:25, Mike Larkin wrote:
>> sysctl net.inet.ip.forwarding=1 ?
>> I'm not a networking expert but I think your VM's subnet mask is wrong for
>> the gateway you are trying to use.
> 
> thank you for your response. I tryed it with net.inet.ip.forwarding being 1 
> and 0. Both don't work. About the subnet, thats what confuses me as well, but 
> the data center tells me that it is correct. As far as i understand it they 
> do some crazy stuff there with there IPv4 routing:
> 
> https://wiki.hetzner.de/index.php/Zusaetzliche_IP-Adressen/en#Subnets
> 
> Thanks and greetings
> Leo
> 



Re: vmd: routing problem

2017-07-20 Thread Leo Unglaub

Hey,

On 07/20/17 06:25, Mike Larkin wrote:

sysctl net.inet.ip.forwarding=1 ?

I'm not a networking expert but I think your VM's subnet mask is wrong for
the gateway you are trying to use.


thank you for your response. I tryed it with net.inet.ip.forwarding 
being 1 and 0. Both don't work. About the subnet, thats what confuses me 
as well, but the data center tells me that it is correct. As far as i 
understand it they do some crazy stuff there with there IPv4 routing:


https://wiki.hetzner.de/index.php/Zusaetzliche_IP-Adressen/en#Subnets

Thanks and greetings
Leo



Re: vmd: routing problem

2017-07-20 Thread Denis Fondras
Hello,

> Can you people see something that i might missed?

The easy way would be enable forwarding, add a vether(4) on the host, bridge it
with tap0 and configure it with an IP in the 136.243.186.160/29 subnet. Use that
IP as the gateway in your VMs.



Re: vmd: routing problem

2017-07-20 Thread Karsten Horsmann
Hi List,

Hetzner has like other dedicated hosting providers an "crazy" looking
network setup for ipv4. Here point to point for the default gw in a
different network segment.

So it's important also to keep that in mind.

Maybe this document helps a bit, need to adapt to Openbsd.

https://wiki.hetzner.de/index.php/KVM_mit_Nutzung_aller_IPs_aus_Subnetz/en

Cheers
Karsten

Am 20.07.2017 6:29 vorm. schrieb "Mike Larkin" :

On Thu, Jul 20, 2017 at 04:23:40AM +0200, Leo Unglaub wrote:
> Hey friends,
> i am trying out vmd and I have a little problem getting networking going
> inside the guest machine. I am not sure if this is a problem in vmd or
> simply my misconfiguration.
>
> From my datacenter i got the following data:
>
> Main Server (OpenBSD GENERIC.MP#99 amd64)
> #
> IP: 144.76.102.204
> Netmask: 255.255.255.224
> Gateway: 144.76.102.193
>
>
> Virtual Machine (OpenBSD GENERIC.MP#99 amd64)
> #
> I got an entire subnet from the datacenter. 136.243.186.160/29 So i
decided
> to use the following IP in it.
>
> IP: 136.243.186.161
> Netmask: 255.255.255.248
> Gateway: 144.76.102.204
>
>
> According to there documentation they always route all subnets on the main
> IP. In my case 144.76.102.204.
>
>
> On my host I configured the em0 interface according to the datacenter data
> and it works fine. The host who runs vmd is connected correctly. In my
> /etc/vm.conf i created a switch called "uplink" and added em0 to it. When
i
> check the current config via ifconfig i get the following.
>
> > em0: flags=8b43
mtu 1500
> > lladdr 90:1b:0e:8b:0f:34
> > description: hetzner-uplink
> > index 1 priority 0 llprio 3
> > groups: egress
> > media: Ethernet autoselect (1000baseT
full-duplex,rxpause,txpause)
> > status: active
> > inet 144.76.102.204 netmask 0xffe0 broadcast 144.76.102.223
> >
> >
> > tap0: flags=8943 mtu
1500
> > lladdr fe:e1:ba:d0:7e:0a
> > description: vm1-if0-foobar
> > index 5 priority 0 llprio 3
> > groups: tap
> > status: active
> >
> > bridge0: flags=41
> > description: switch1-uplink
> > index 7 llprio 3
> > groups: bridge
> > priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6
proto rstp
> > em0 flags=3
> > port 1 ifpriority 0 ifcost 0
> > tap0 flags=3
> > port 5 ifpriority 0 ifcost 0
> > Addresses (max cache: 100, timeout: 240):
> > 0c:86:10:ed:35:58 em0 1 flags=0<>
>
> My /etc/vm.conf looks like this:
>
> > switch "uplink" {
> > add em0
> > }
> >
> > vm "foobar" {
> > memory 2G
> > disk "/tmp/1.vdi"
> > interface {
> > switch "uplink"
> > }
> > }
>
> When i start the vm with my current /bsd.rd i start the installer and
insert
> the following:
>
> > Available network interfaces are: vio0 vlan0.
> > Which network interface do you wish to configure? (or 'done') [vio0]
> > IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp] 136.243.186.161
> > Netmask for vio0? [255.255.255.248] IPv6 address for vio0? (or
> > 'autoconf' or 'none') [none] Available network interfaces are: vio0
> > vlan0.
> > Which network interface do you wish to configure? (or 'done') [done]
> > Default IPv4 route? (IPv4 address or none) 144.76.102.204
> > add net default: gateway 144.76.102.204: Network is unreachable
>
> Can you people see something that i might missed?
> Big thanks in advance and greetings
> Leo
>
>

sysctl net.inet.ip.forwarding=1 ?

I'm not a networking expert but I think your VM's subnet mask is wrong for
the gateway you are trying to use.

-ml


Re: vmd: routing problem

2017-07-19 Thread Mike Larkin
On Thu, Jul 20, 2017 at 04:23:40AM +0200, Leo Unglaub wrote:
> Hey friends,
> i am trying out vmd and I have a little problem getting networking going
> inside the guest machine. I am not sure if this is a problem in vmd or
> simply my misconfiguration.
> 
> From my datacenter i got the following data:
> 
> Main Server (OpenBSD GENERIC.MP#99 amd64)
> #
> IP: 144.76.102.204
> Netmask: 255.255.255.224
> Gateway: 144.76.102.193
> 
> 
> Virtual Machine (OpenBSD GENERIC.MP#99 amd64)
> #
> I got an entire subnet from the datacenter. 136.243.186.160/29 So i decided
> to use the following IP in it.
> 
> IP: 136.243.186.161
> Netmask: 255.255.255.248
> Gateway: 144.76.102.204
> 
> 
> According to there documentation they always route all subnets on the main
> IP. In my case 144.76.102.204.
> 
> 
> On my host I configured the em0 interface according to the datacenter data
> and it works fine. The host who runs vmd is connected correctly. In my
> /etc/vm.conf i created a switch called "uplink" and added em0 to it. When i
> check the current config via ifconfig i get the following.
> 
> > em0: flags=8b43 
> > mtu 1500
> > lladdr 90:1b:0e:8b:0f:34
> > description: hetzner-uplink
> > index 1 priority 0 llprio 3
> > groups: egress
> > media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
> > status: active
> > inet 144.76.102.204 netmask 0xffe0 broadcast 144.76.102.223
> > 
> > 
> > tap0: flags=8943 mtu 1500
> > lladdr fe:e1:ba:d0:7e:0a
> > description: vm1-if0-foobar
> > index 5 priority 0 llprio 3
> > groups: tap
> > status: active
> > 
> > bridge0: flags=41
> > description: switch1-uplink
> > index 7 llprio 3
> > groups: bridge
> > priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto 
> > rstp
> > em0 flags=3
> > port 1 ifpriority 0 ifcost 0
> > tap0 flags=3
> > port 5 ifpriority 0 ifcost 0
> > Addresses (max cache: 100, timeout: 240):
> > 0c:86:10:ed:35:58 em0 1 flags=0<>
> 
> My /etc/vm.conf looks like this:
> 
> > switch "uplink" {
> > add em0
> > }
> > 
> > vm "foobar" {
> > memory 2G
> > disk "/tmp/1.vdi"
> > interface {
> > switch "uplink"
> > }
> > }
> 
> When i start the vm with my current /bsd.rd i start the installer and insert
> the following:
> 
> > Available network interfaces are: vio0 vlan0.
> > Which network interface do you wish to configure? (or 'done') [vio0]
> > IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp] 136.243.186.161
> > Netmask for vio0? [255.255.255.248] IPv6 address for vio0? (or
> > 'autoconf' or 'none') [none] Available network interfaces are: vio0
> > vlan0.
> > Which network interface do you wish to configure? (or 'done') [done]
> > Default IPv4 route? (IPv4 address or none) 144.76.102.204
> > add net default: gateway 144.76.102.204: Network is unreachable
> 
> Can you people see something that i might missed?
> Big thanks in advance and greetings
> Leo
> 
> 

sysctl net.inet.ip.forwarding=1 ?

I'm not a networking expert but I think your VM's subnet mask is wrong for
the gateway you are trying to use.

-ml



vmd: routing problem

2017-07-19 Thread Leo Unglaub

Hey friends,
i am trying out vmd and I have a little problem getting networking going 
inside the guest machine. I am not sure if this is a problem in vmd or 
simply my misconfiguration.


From my datacenter i got the following data:

Main Server (OpenBSD GENERIC.MP#99 amd64)
#
IP: 144.76.102.204
Netmask: 255.255.255.224
Gateway: 144.76.102.193


Virtual Machine (OpenBSD GENERIC.MP#99 amd64)
#
I got an entire subnet from the datacenter. 136.243.186.160/29 So i 
decided to use the following IP in it.


IP: 136.243.186.161
Netmask: 255.255.255.248
Gateway: 144.76.102.204


According to there documentation they always route all subnets on the 
main IP. In my case 144.76.102.204.



On my host I configured the em0 interface according to the datacenter 
data and it works fine. The host who runs vmd is connected correctly. In 
my /etc/vm.conf i created a switch called "uplink" and added em0 to it. 
When i check the current config via ifconfig i get the following.



em0: flags=8b43 mtu 
1500
lladdr 90:1b:0e:8b:0f:34
description: hetzner-uplink
index 1 priority 0 llprio 3
groups: egress
media: Ethernet autoselect (1000baseT full-duplex,rxpause,txpause)
status: active
inet 144.76.102.204 netmask 0xffe0 broadcast 144.76.102.223


tap0: flags=8943 mtu 1500
lladdr fe:e1:ba:d0:7e:0a
description: vm1-if0-foobar
index 5 priority 0 llprio 3
groups: tap
status: active

bridge0: flags=41
description: switch1-uplink
index 7 llprio 3
groups: bridge
priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp
em0 flags=3
port 1 ifpriority 0 ifcost 0
tap0 flags=3
port 5 ifpriority 0 ifcost 0
Addresses (max cache: 100, timeout: 240):
0c:86:10:ed:35:58 em0 1 flags=0<>


My /etc/vm.conf looks like this:


switch "uplink" {
add em0
}

vm "foobar" {
memory 2G
disk "/tmp/1.vdi"
interface {
switch "uplink"
}
}


When i start the vm with my current /bsd.rd i start the installer and 
insert the following:



Available network interfaces are: vio0 vlan0.
Which network interface do you wish to configure? (or 'done') [vio0] 
IPv4 address for vio0? (or 'dhcp' or 'none') [dhcp] 136.243.186.161
Netmask for vio0? [255.255.255.248] 
IPv6 address for vio0? (or 'autoconf' or 'none') [none] 
Available network interfaces are: vio0 vlan0.
Which network interface do you wish to configure? (or 'done') [done] 
Default IPv4 route? (IPv4 address or none) 144.76.102.204

add net default: gateway 144.76.102.204: Network is unreachable


Can you people see something that i might missed?
Big thanks in advance and greetings
Leo