OpenVZ Forum


Home » General » Support » Gateway 192.0.2.1 with Ubuntu-8.04 and Debian 4.0
Gateway 192.0.2.1 with Ubuntu-8.04 and Debian 4.0 [message #33876] Mon, 17 November 2008 22:36 Go to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
I am new to OpenVZ so please be graceful...

On two hostsystems (ubuntu 8.04, Debian Lenny) I installed each a VE ununtu-8.04-minimal. In both envirements a gateway 192.0.2.1 is added and the network does not work. Changing the /etc/network/interfaces to correct values and after a network restart everything works.
After a reboot of the VE the /etc/network/interfaces is crappy again:
# This configuration file is auto-generated.
# WARNING: Do not edit this file, otherwise your changes will be lost.
# Please edit template /etc/network/interfaces.template instead.
auto lo
iface lo inet loopback

auto venet0
iface venet0 inet manual
        up ifconfig venet0 0
        up route add -net 192.0.2.1 netmask 255.255.255.255 dev venet0
        up route add default gw 192.0.2.1
auto venet0:0
iface venet0:0 inet static
        address 192.168.3.105
        netmask 255.255.255.255
        broadcast 0.0.0.0

This ist the routing table:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.0.2.1       0.0.0.0         255.255.255.255 UH    0      0        0 venet0
0.0.0.0         192.0.2.1       0.0.0.0         UG    0      0        0 venet0


The same problem using debian-4.0-minimal.

How do I get rid of this problem?

Thx...
Re: Gateway 192.0.2.1 with Ubuntu-8.04 and Debian 4.0 [message #33888 is a reply to message #33876] Tue, 18 November 2008 09:27 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

actually, if you're only using venet interface it doesn't matter what kind of ip address of default gateway you have inside VE because the next hop is always on the HN, the only important thing is device of the default gateway which should be venet0.

So, you shouldn't have bothered about the ip address of the default gateway.

Use, "vzctl set $VEID --ipadd $IP [--save]" command to add an ip address to your VE.

If it doesn't work (and you've mentioned than some problem occured) please:

1. check sysctl parameters (for example please look at this page
http://wiki.openvz.org/Quick_installation#sysctl)

2. Please show "ip a l", "ip rule list", "ip r l" (from HN and from inside the VE), "arp -n" (from the HN)

3. Or you can use tcpdump utility: run tcpdump on the venet interface inside VE, on the venet interface on the HN, on physical interface on the HN.
Re: Gateway 192.0.2.1 with Ubuntu-8.04 and Debian 4.0 [message #33893 is a reply to message #33888] Tue, 18 November 2008 15:08 Go to previous messageGo to next message
tanteauguri is currently offline  tanteauguri
Messages: 8
Registered: November 2008
Junior Member
I use exactly the same parameters in sysctl.conf:
root@openvz01:~# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
root@openvz01:~#  


I create a fresh Server with this script:

root@openvz01:~# cat /etc/scripts/make_ev.sh
vzctl create 101 --ostemplate ubuntu-8.04-i386-minimal
vzctl set 101 --onboot yes --save
vzctl set 101 --ipadd 193.80.225.63 --save
vzctl set 101 --nameserver 193.80.225.58 --save
vzctl set 101 --hostname ev101 --save

root@openvz01:~# /etc/scripts/make_ev.sh
Creating VE private area (ubuntu-8.04-i386-minimal)
Performing postcreate actions
VE private area was created
Saved parameters for VE 101
Saved parameters for VE 101
Saved parameters for VE 101
Saved parameters for VE 101
root@openvz01:~#


I start the new VE and recieve an error:
root@openvz01:~# vzctl start  101
Starting VE ...
VE is mounted
Adding IP address(es): 193.80.225.63
vps-net_add WARNING: Function proxy_arp for eth0 is set to 0. Enable with 'sysctl -w net.ipv4.conf.eth0.proxy_arp=1'. See /usr/share/doc/vzctl/README.Debian.
Setting CPU units: 1000
Configure meminfo: 65536
Set hostname: ev101
File resolv.conf was modified
VE start in progress...
root@openvz01:~#     


I enter the Machine an have a crappy route:
root@openvz01:~# vzctl enter 101
entered into VE 101
root@ev101:/# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.0.2.1       0.0.0.0         255.255.255.255 UH    0      0        0 venet0
0.0.0.0         192.0.2.1       0.0.0.0         UG    0      0        0 venet0
root@ev101:/# 


The IP commands inside the VE:

root@ev101:/# ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> 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
2: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue
    link/void
    inet 127.0.0.1/32 scope host venet0
    inet 193.80.225.63/32 scope global venet0:0
root@ev101:/# ip r l
192.0.2.1 dev venet0  scope link
default via 192.0.2.1 dev venet0
root@ev101:/# 


The IP commands inside the HN:

root@ev101:/# logout
exited from VE 101
root@openvz01:~# ip a l
1: lo: <LOOPBACK,UP,LOWER_UP> 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
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:14:5e:c9:28:9f brd ff:ff:ff:ff:ff:ff
    inet 193.80.225.62/25 brd 193.80.254.127 scope global eth0
    inet6 fe80::214:5eff:fec9:289f/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:02:44:52:79:54 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether 00:02:44:51:38:33 brd ff:ff:ff:ff:ff:ff
5: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue
    link/void
root@openvz01:~# ip r l
193.80.225.63 dev venet0  scope link  src 193.80.225.62
193.80.225.0/25 dev eth0  proto kernel  scope link  src 193.80.225.62
default via 193.80.225.1 dev eth0  metric 100
root@openvz01:~# 


A not very elegant solution is to add FAKEGATEWAY=193.80.225.1 to the script debian-add_ip.sh.

I run 300 vservers and would like to change to OpenVZ, so I would prefer a clean solution.
Thanks for your help.

[Updated on: Tue, 18 November 2008 15:38]

Report message to a moderator

Re: Gateway 192.0.2.1 with Ubuntu-8.04 and Debian 4.0 [message #33911 is a reply to message #33893] Wed, 19 November 2008 13:37 Go to previous message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

Quote:


vps-net_add WARNING: Function proxy_arp for eth0 is set to 0. Enable with 'sysctl -w net.ipv4.conf.eth0.proxy_arp=1'. See /usr/share/doc/vzctl/README.



Actually, it's not a error.

Could you please use tcpdump:

- try to ping your VE, at the same moment run tcpdump utility on the eth0 interface on the HN, on venet interface on the HN and on venet interface inside VE.

- please also specify "uname -a", "vzctl --version" and where have you got debian-4.0-minimal template you use to create VE.
Previous Topic: *SOLVED* Samba server in VE
Next Topic: shorewall in VE
Goto Forum:
  


Current Time: Fri Sep 27 19:19:32 GMT 2024

Total time taken to generate the page: 0.04283 seconds