OpenVZ Forum


Home » General » Support » Server4you Server and Connecting to the Internet and from the Internet
Server4you Server and Connecting to the Internet and from the Internet [message #10632] Sun, 25 February 2007 00:46 Go to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
I've got an new Server with 2 IP Adresses.
The Main Adress Is connected and uprunning.
I assigned the IP Adress to the vServer but, i wasn't abble to get an connection to the internet.
I tried it, by assigning the IP by to the hostsystem as eth0:1 or just assigning it into the vServer.
It didn't work at all.
greets
draco
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10671 is a reply to message #10632] Mon, 26 February 2007 11:17 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
Quote:


I assigned the IP Adress to the vServer but, i wasn't abble to get an connection to the internet.
I tried it, by assigning the IP by to the hostsystem as eth0:1 or just assigning it into the vServer.



Hello,

you shouldn't create eth0:1 or assign IP address in VE!
Please, read manuals! Smile You should use `vzctl set <veid> --ipadd` command.

Vasily
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10689 is a reply to message #10671] Mon, 26 February 2007 17:13 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
Ok, first of all, I'm Using Debian Linux 3.1 on two boxes.
Here is, what I did:

I Edited the
/etc/network/interfaces
like this:
# /etc/network/interfaces - network interfaces configuration

# loopback interface

auto lo
iface lo inet loopback

# ethernet interface

auto eth0
iface eth0 inet static
  address 11.22.33.152
  network 11.22.33.0
  netmask 255.255.255.0
  broadcast 11.22.33.255
  gateway 11.22.33.1

# virtual interfaces
auto eth0:1
iface eth0:1 inet static
address 11.22.33.172
network 11.22.33.0
netmask 255.255.255.0
broadcast 11.22.33.255
gateway 11.22.33.1


the I entered following command twice:
#ifup -a
Then I assigned it to the VE
vzctl set 100 --ipadd 11.22.33.172 --save
vzctl start 100
vzctl enter 100
But all of it didn't work.
Im trying to tell him where to find the router, but if this dosn't work, I don't know what to do else.
Is it possible that IP Tables blocks the VE?

[Updated on: Mon, 26 February 2007 18:05]

Report message to a moderator

Re: Server4you Server and Connecting to the Internet and from the Internet [message #10691 is a reply to message #10689] Mon, 26 February 2007 17:16 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
You forgot to add --save option, when setting IP address:

vzctl set 100 --ipadd 11.22.33.172 --save

[Updated on: Mon, 26 February 2007 17:16]

Report message to a moderator

Re: Server4you Server and Connecting to the Internet and from the Internet [message #10700 is a reply to message #10632] Mon, 26 February 2007 17:56 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
forgot to type that during entering the commands in this forum.
The IP got assigned to the ve
^^
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10701 is a reply to message #10632] Mon, 26 February 2007 18:01 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
by the way, more about the ve

root@localhost:/# ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:1398 (1.3 KiB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:11.22.33.172 P-t-P:11.22.33.172 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

the /etc/network/interfaces

# 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 generated venet0 interfaces
auto venet0 lo
iface venet0 inet static
address 127.0.0.1
netmask 255.255.255.255
broadcast 0.0.0.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
iface lo inet loopback

auto venet0:0
iface venet0:0 inet static
address 11.22.33.172
netmask 255.255.255.255
broadcast 0.0.0.0

I tried to add routing information or korrekt the netmask, but every time i restarted the ve, every setting is reseted to this.

I tried this as Routes
up route add -net 11.22.33.1 netmask 255.255.255.0 venet0
up route add default gw 11.22.33.1 venet0

But as i said, vzctl overwrites my settings.

Sad
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10705 is a reply to message #10632] Mon, 26 February 2007 19:03 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
From in the VE context, you cannot manage ip addressing at all. Any attempts via config files or ifconfig will be futile. Instead, you should use "vzctl set VEID --ipadd x.x.x.x --save" from the HN as already explained and documented in the manual. So, just to be clear, you do not need to / cannot use debians interface management scripts/configs from inside the VE. The VE ifconfig output you provided shows that the address was added correctly to your VE. Assuming your HN can route that address properly, your VE will have network connectivity.

Rick


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10707 is a reply to message #10632] Mon, 26 February 2007 20:09 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
but how do i change the netmask?
My Providers only accepts 255.255.255.0
Also how do I tell hime to use the default gateway of the provider?
I enter a nameserver into the ve (resolv.conf)

Wink
I don't get it, why it doesn't work?????? Embarassed
Re: Server4you Server and Connecting to the Internet and from the Internet [message #10708 is a reply to message #10707] Mon, 26 February 2007 20:29 Go to previous messageGo to next message
rickb is currently offline  rickb
Messages: 368
Registered: October 2006
Senior Member
First, have you read the openvz manual?

Everyone on this forum is very friendly and happy to help solve problems to push the project forward. Openvz has excellent documentation and community support- but we cannot learn it for you.


Give a man a fish and he'll eat for a day. Teach a man how to fish and he'll eat for a lifetime.


-------------
Common Terms I post with: http://wiki.openvz.org/Category:Definitions

UBC. Learn it, love it, live it: http://wiki.openvz.org/Proc/user_beancounters
Re: Server4you Server and Connecting to the Internet and from the Internet [message #11660 is a reply to message #10632] Sun, 01 April 2007 20:08 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
I tried and tried almost everything.
I don't know how to go on any further.
I created it, like it was shown in several Tutorials.
I can't ping inside of the server to the outside.
The only thing that happens is, that ping tries to send an ICMP Request.
But nothing happens.
I tried to check the firewall, but thats not the Problem.
Can't anybody help me?
Re: Server4you Server and Connecting to the Internet and from the Internet [message #11663 is a reply to message #11660] Sun, 01 April 2007 21:11 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

a possible solution can be, to set a private IP to VE, and use DNAT descibed in the wiki (-> http://wiki.openvz.org/Using_NAT_for_VE_with_private_IPs )
with your offical ip (eth0:alias) eth0:1


Re: Server4you Server and Connecting to the Internet and from the Internet [message #11726 is a reply to message #11663] Tue, 03 April 2007 19:09 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
I assined the IP directly to that VPS.
But the Problem is the Subnet mask, that is propaly not working.
How do I find out, if the IP isn't or is accepted by anykind of Firewall?

thx
draco
Re: Server4you Server and Connecting to the Internet and from the Internet [message #11748 is a reply to message #10632] Wed, 04 April 2007 18:49 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
Ok,
ping on the host system works over
eth0 and eth0:1

this is, what ifconfig prints:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.1 P-t-P:127.0.0.1 Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:11.22.33.172 P-t-P:11.22.33.172 Bcast:0.0.0.0 Mask:255.255.255.0
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

Ass you can see, venet0:0 is setup correctly, the only missmatching is the subnetmask with 255.255.255.0

How can I correct this, or wath went wrong?

I will try to setup the vps today brandnew and try to bring her up then

thx

draco
Re: Server4you Server and Connecting to the Internet and from the Internet [message #11750 is a reply to message #10632] Wed, 04 April 2007 20:34 Go to previous messageGo to next message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
Here is what i did on this run.
First
apt-get install debootstrap
debootstrap --arch i386 sarge /vz/private/777 http://ftp.freenet.de/debian
vzctl set 777 --applyconfig vps.basic --save
echo "OSTEMPLATE=debian-3.1" >> /etc/vz/conf/777.conf
vzctl set 777 --ipadd x.x.x.x --save
vzctl set 777 --nameserver x.x.x.x --save
as Nameserver i used this on:
nameserver 134.109.192.18

cat << EOF > /vz/private/777/etc/apt/sources.list
deb http://ftp.freenet.de/debian stable main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free
EOF

vzctl set 777 --hostname hostname --save

vzctl start 777

vzctl enter 777
export PATH=/sbin:/usr/sbin:/bin:/usr/bin

pwconv

apt-get update

The only thing is, I see is failure resolbing ....
or failed to fetch .......
I did everything as mentioned inside the manuals.
I don't know what to do else.
I am, how should i say, helpless.
I don't know what i am doing wrong.
Please can someone help me!

thx
draco
Re: Server4you Server and Connecting to the Internet and from the Internet [message #11770 is a reply to message #11750] Thu, 05 April 2007 16:24 Go to previous messageGo to next message
mh720 is currently offline  mh720
Messages: 7
Registered: August 2006
Junior Member
I'm going to take a guess here, are the two IP addresses from your provider on DIFFERENT subnets? If so, give this a try (works for me). Please report back so that I can update the wiki.


Example with hwnode on 1.2.3.0/24 and VE somwhere on 2.3.4.0/29 with a gateway of 2.3.4.1:


Configure hwnode subnet normally. Then to add the second subnet for the VE:

node# route add -net 2.3.4.0/29 eth0
node# ip rule add from 2.3.4.0/29 table 1
node# ip route add default dev eth0 via 2.3.4.1 table 1

Then do your 'vzctl set veid --ipadd 2.3.4.2 --save' as normal.


That should be it. You can 'man ip' to read more about 'Route tables'. If you add yet another subnet, you might use table 2.


I believe I originally read about this on
https://wiki.openvz.org/Source_based_routing


-mike

[Updated on: Thu, 05 April 2007 16:27]

Report message to a moderator

Re: Server4you Server and Connecting to the Internet and from the Internet [message #11775 is a reply to message #10632] Thu, 05 April 2007 20:27 Go to previous message
dragon001 is currently offline  dragon001
Messages: 16
Registered: February 2007
Junior Member
I got an error message, but i don't know what i did wrong:

echo447:~# route add -net 2.3.4.0/29 eth0
route: Netzmaske passt nicht zur Routenadresse
Benutzung: route [-nNvee] [-FC] [<AF>] Kernelroutentabelle anzeigen
route [-v] [-FC] {add|del|flush} ... Routentabelle für AF ändern.

route {-h|--help} [<AF>] Genaue Syntax für AF anzeigen.
route {-V|--version} Version/Autor anzeigen und Ende.

-v, --verbose Ausführliche Ausgaben
-n, --numeric don't resolve names
-e, --extend display other/more information
-F, --fib display Forwarding Information Base (default)
-C, --cache Routencache statt FIB anzeigen

<AF>=Use '-A <af>' or '--<af>'; default: inet
Liste möglicher Adressfamilien, die Routen unterstützen:
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)

I entered route on the host and got this screen:
host:~# route
Kernel IP Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
8.1.1.1 * 255.255.255.192 U 0 0 0 eth0
7.1.1.1 * 255.255.255.0 U 0 0 0 eth0

MFG
draco
Previous Topic: How to setup bonding in a VPS?
Next Topic: *SOLVED* Wiki Update for Debian Installation
Goto Forum:
  


Current Time: Wed Jul 10 05:32:33 GMT 2024

Total time taken to generate the page: 0.02604 seconds