Set gateway on internal interface

reetp

Renowned Member
Aug 19, 2013
67
11
73
Had a look around here but still not sure of the answer - keep getting stuck :-(

Using Prox 6.

I have a 'real' server with an online provider which has an 'external' interface plus an 'internal' one so I can theoretically connect to another server I have in their space.

I can happily set the bridge interface for the external stuff but I just can't seem to set up the 'internal interface, usually stumbling at adding a gateway.

If I use the network configuration I get the dreaded:

Code:
Parameter verification failed. (400)
gateway: Default gateway already exists on interface 'vmbr0

I have tried adding it manually but nothing seems very happy.

The internal interface should be:

Address 10.90.44.13/26
GW 10.90.44.1

Tried setting up both a bridge to the second eth port, and direct to the second eth port.

I'd like to use their internal network to move some VMs about but this is proving to be a bit of a pain!

Found this sort of setting elsewhere in these forums:

cat /etc/network/interfaces
Code:
auto eno2

iface eno2 inet static
    address  10.90.44.13
    netmask  26

cat /etc/network/if-up.d/route

#!/bin/sh route add -net 10.90.44.0/26 gw 10.90.44.1 dev eno2

That give this:

route

Code:
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         111-154-222-1.r 0.0.0.0         UG    0      0        0 vmbr0
10.90.44.0      10.90.44.1      255.255.255.192 UG    0      0        0 eno2
10.90.44.0      0.0.0.0         255.255.255.192 U     0      0        0 eno2
111.154.222.0   0.0.0.0         255.255.255.0   U     0      0        0 vmbr0

I also note that the other box seems to have an internal IP:

Address 10.90.114.218/26
GW 10.90.114.193

Not quite sure how they are going to talk to each other!

Any suggestions appreciated.
 
hi, indeed you can't have 2 default gw.

if your second box have 10.90.114.218/26,
you need to add a route "route add -net 10.90.114.0/26 gw 10.90.44.1 dev eno2" on the first box.

and on the second box, a route to the first box
"route add -net 10.90.44.0/26 gw 10.90.144.1 dev eno2"
 
Thanks for responding.

Hmm. Less than happy but no idea why

One end is seemingly OK but the other not. Any suggestions appreciated:


Box 1 - Settings from provider

10.90.44.13
Reverse
MAC address 20:47:47:8f:70:00
network mask 255.255.255.192
IPv6 SLAAC Unavailable
status ready gateway 10.90.44.1
device 2 type PRIVATE
cidr /26

ip addr add 10.90.44.13/26 dev eno2
ip link set eno2 up
ip addr show

All good:

3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:47:47:8f:70:00 brd ff:ff:ff:ff:ff:ff
inet 10.90.44.13/26 scope global eno2

route add -net 10.90.114.0/26 gw 10.90.44.1 dev eno2

Yup:

Destination Gateway Genmask Flags Metric Ref Use Iface
default 1-1-1-1.r 0.0.0.0 UG 0 0 0 vmbr0
10.90.44.0 0.0.0.0 255.255.255.192 U 0 0 0 eno2
10.90.114.0 10.90.44.1 255.255.255.192 UG 0 0 0 eno2
1.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 vmbr0



Box 2 - Settings from provider

10.90.114.218
Reverse
MAC address d4:ae:52:cc:13:b8
network mask 255.255.255.192
IPv6 SLAAC Unavailable
status ready gateway 10.90.114.193
device 2 type PRIVATE
cidr /26


ip addr add 10.90.114.218/26 dev eth1
ip link set eth1 up
ip addr show eth1

All good:

3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d4:ae:52:cc:13:b8 brd ff:ff:ff:ff:ff:ff
inet 10.90.114.218/26 scope global eth1


route add -net 10.90.44.0/26 gw 10.90.144.193 dev eth1
SIOCADDRT: Network is unreachable

Damn.

Destination Gateway Genmask Flags Metric Ref Use Iface
default 2-2-2-2.re 0.0.0.0 UG 0 0 0 vmbr0
10.90.114.192 0.0.0.0 255.255.255.192 U 0 0 0 eth1
2.2.2.0 0.0.0.0 255.255.255.0 U 0 0 0 vmbr0
 
Code:
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d4:ae:52:cc:13:b8 brd ff:ff:ff:ff:ff:ff
inet 10.90.114.218/26 scope global eth1


route add -net 10.90.44.0/26 gw 10.90.144.193 dev eth1
SIOCADDRT: Network is unreachable

you can't reach a gw 10.90.144.193 from 10.90.114.218

(I think it's a typo as you said that provider provide "10.90.114.193")
 
you can't reach a gw 10.90.144.193 from 10.90.114.218

(I think it's a typo as you said that provider provide "10.90.114.193")

It was indeed!!!! I was getting number blind...

Well, it sets the route, but it still won't bloody work. Grrrrrr!

I must be missing a trick somewhere.

Ahhh - sussed it. Route was still not quite right

This did it:
route add -net 10.90.114.192/26 gw 10.90.44.1 dev eno2

(other IP is on 10.90.114.218/26)

So i ended up with this:

Box 1

ip addr add 10.90.44.13/26 dev eno2
ip link set eno2 up
route add -net 10.90.114.192/26 gw 10.90.44.1 dev eno2

eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether d4:ae:52:cc:13:b8 brd ff:ff:ff:ff:ff:ff
inet 10.90.114.218/26 scope global eth1

Route
10.90.44.0 10.90.114.193 255.255.255.192 UG 0 0 0 eth1
10.90.114.192 0.0.0.0 255.255.255.192 U 0 0 0 eth1


Box 2

ip addr add 10.90.114.218/26 dev eth1
ip link set eth1 up
route add -net 10.90.44.0/26 gw 10.90.114.193 dev eth1

eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 20:47:47:8f:70:00 brd ff:ff:ff:ff:ff:ff
inet 10.90.44.13/26 scope global eno2

Route
10.90.44.0 0.0.0.0 255.255.255.192 U 0 0 0 eno2
10.90.114.192 10.90.44.1 255.255.255.192 UG 0 0 0 eno2

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!