OpenVZ Forum


Home » General » Support » Multiple Public IPs/Subnets
Multiple Public IPs/Subnets [message #12534] Wed, 02 May 2007 10:25
wese is currently offline  wese
Messages: 1
Registered: April 2007
Location: Austria
Junior Member

Hi guys and gals,

First of all, i already read'n tried http://wiki.openvz.org/Source_based_routing + many other hints/tips on this forum, none did solve my current issue.
I apologize if i missed any post which already covered this issue, but i tried hard to get all info's on this and similar topics.

so...
ip rule add from 78.47.242.201/29 table 6
ip route del default dev eth0 via 78.47.242.201 table 6

... didnt help at all.

Problem
If i pick an IP from the 2nd Subnet it will always show the IP from the HOST System (in this case 88.198.65.174), but it should show the actual VE Ip.

ifconfig|grep inet\ addr && echo "          Getting Public-IP: www.myip.dk" && w3m -dump http://www.myip.dk|grep [0-9].[0-9].[0-9].[0-9]
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          inet addr:78.47.242.206  P-t-P:78.47.242.206  Bcast:0.0.0.0  Mask:255.255.255.255
          Getting Public-IP: www.myip.dk
                                 88.198.65.174 << WRONG! Should be 78.47.242.206 :(


Idea
While trying around i got the Idea to change the:
#VE_ROUTE_SRC_DEV="eth0"
to eth0:1, but if i do so it may break the current running VEs,
And sadly it cant be set individually for the VEs.

OR
Do i have to setup another VENET?

Details
1 NIC eth0 using 1 additional Virtual Nic eth0:1
I got 2 Subnets:
88.198.65.174/27 GW 88.198.65.161 
** 88.198.65.174 is the Main IP on the Host System 
** no other IP from this Subnet will be used since its a shared Subnet

78.47.242.200/29 GW 78.47.242.201 
** this the Subnet which is planned for the VE's 
** 78.47.242.206 is used in this case
###### Debian /etc/network/interfaces
# Loopback device:
auto lo eth0 eth0:1
iface lo inet loopback

# device: eth0
iface eth0 inet static
        address 88.198.65.174
        broadcast 88.198.65.191
        netmask 255.255.255.224
        gateway 88.198.65.161
        up route add -net 88.198.65.160 netmask 255.255.255.224 gw 88.198.65.161 eth0

# default route to access subnet:

iface eth0:1 inet static
        address 78.47.242.202
        netmask 255.255.255.248
        broadcast 78.47.242.207
        network 78.47.242.200
        gateway 78.47.242.201
        up route add -net 78.47.242.200 netmask 255.255.255.248 gw 78.47.242.201 eth0

###### HOST SYSTEM ifconfig
#
## HN ##
#
2: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
6: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:11:6b:93:6c:ba brd ff:ff:ff:ff:ff:ff
    inet 88.198.65.174/27 brd 88.198.65.191 scope global eth0
    inet 78.47.242.202/29 brd 78.47.242.207 scope global eth0:1
    inet6 fe80::211:6bff:fe93:6cba/64 scope link
       valid_lft forever preferred_lft forever
1: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
    link/void
10.0.0.110 dev venet0  scope link
10.0.0.201 dev venet0  scope link
10.0.0.200 dev venet0  scope link
78.47.242.206 dev venet0  scope link
10.0.0.105 dev venet0  scope link
78.47.242.200/29 via 78.47.242.201 dev eth0  src 78.47.242.202
78.47.242.200/29 dev eth0  proto kernel  scope link  src 78.47.242.202
88.198.65.160/27 via 88.198.65.161 dev eth0
88.198.65.160/27 dev eth0  proto kernel  scope link  src 88.198.65.174
default via 88.198.65.161 dev eth0
#
## VE ##
#
1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
3: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,10000> mtu 1500 qdisc noqueue
    link/void
    inet 127.0.0.1/32 scope host venet0
    inet 78.47.242.206/32 scope global venet0:0
192.0.2.1 dev venet0  scope link
default via 192.0.2.1 dev venet0

# rule on the HOST: (created according to the wiki page)
# if i add/remove this one it doesnt change a bit
#
# ip rule
0:      from all lookup 255
32765:  from 78.47.242.200/29 lookup 6
32766:  from all lookup main
32767:  from all lookup default
#
## PING ##
#
## From a Remote Host to 78.47.242.206
#
ping 78.47.242.206 -c1
PING 78.47.242.206 (78.47.242.206) 56(84) bytes of data.
64 bytes from 78.47.242.206: icmp_seq=1 ttl=52 time=22.4 ms

--- 78.47.242.206 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 22.433/22.433/22.433/0.000 ms
# 
## From the VE to the Remote Host
#
ping void.dead.at -c1
PING void.dead.at (80.237.141.65) 56(84) bytes of data.
64 bytes from void.dead.at (80.237.141.65): icmp_seq=1 ttl=53 time=7.61 ms

--- void.dead.at ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 7.611/7.611/7.611/0.000 ms

#
## Traceroute ##
#
## VE @ Outworld ##
# BAD!
# Goes straight trough the wrong gateway, against the Route.
#
traceroute to 80.237.141.65 (80.237.141.65), 30 hops max, 40 byte packets
 1  88.198.65.174 (88.198.65.174)  0.051 ms  0.046 ms  0.020 ms
 2  213.239.252.129 (213.239.252.129)  5.287 ms  0.206 ms  0.195
#
#
## Outworld @ VE ##
# Good!
# Routed inside as supposed
#
11  78.47.242.202 (78.47.242.202)  7.593 ms  7.336 ms  7.347 ms
12  78.47.242.206 (78.47.242.206)  7.234 ms  7.340 ms  7.214 ms



Maybe i just missed something simple but I hope its not too confusing.
If i can provide you with more details let me know.

Hints, Tips, etc are welcome.

Tia,
René

/Edit changed the Route/Ifconfig style
//Added Pings
//Added Traceroutes

[Updated on: Wed, 02 May 2007 15:04]

Report message to a moderator

 
Read Message
Previous Topic: Hard lock on boot after install ovzkernel
Next Topic: 1 VPS IP, Multiple Host Interfaces
Goto Forum:
  


Current Time: Wed Aug 07 11:48:07 GMT 2024

Total time taken to generate the page: 0.03768 seconds