Server4you Server and Connecting to the Internet and from the Internet [message #10632] |
Sun, 25 February 2007 00:46 |
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 #10689 is a reply to message #10671] |
Mon, 26 February 2007 17:13 |
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 #11770 is a reply to message #11750] |
Thu, 05 April 2007 16:24 |
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 |
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
|
|
|