OpenVZ Forum


Home » General » Support » networking on LFS based distro
networking on LFS based distro [message #2882] Mon, 24 April 2006 20:28 Go to next message
liamr is currently offline  liamr
Messages: 10
Registered: April 2006
Junior Member
I'm trying to bring openvz up on an LFS based distro we use at work. I'm not sure which version of the LFS book we used to build it..

Anyhoo.. after some mucking around w/ the scripts in /etc/sysconfig/vz-scripts/dists/scripts, I've made my own set of lfs-add_ip.sh, lfs-del_ip.sh, lfs-set_hostname.sh, and they're sort of working.

The hostname seems to get set.. I get some networking, but I don't seem to have any working routes. Here's the output of "ifconfig -a"

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
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:9 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:3101 (3.0 Kb) 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:141.213.xxx.yyy P-t-P:141.213.xxx.yyy Bcast:0.0.0.0 Mask:255.255.255.255
UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

The broadcast isn't set quite right on venet0:0, but I'm not convinced that's the problem. Route doesn't return anything:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface

If I try to add the route by hand, I get "SIOCADDRT: Network is unreachable". Any ideas on how to get this working?

thx
Liam
Re: networking on LFS based distro [message #2894 is a reply to message #2882] Tue, 25 April 2006 16:03 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

check routing inside VPS with some other distr template VPS (e.g. CentOs).
try inside VPS:
# ip r a default via 191.255.255.1 dev venet0
this addr is quite arbitrary to setup default GW.
Also check that you have ip_forward enabled in host system:
# cat /proc/sys/net/ipv4/ip_forward



http://static.openvz.org/userbars/openvz-developer.png
Re: networking on LFS based distro [message #2897 is a reply to message #2894] Tue, 25 April 2006 16:18 Go to previous messageGo to next message
liamr is currently offline  liamr
Messages: 10
Registered: April 2006
Junior Member
From the host system..

simlish-root# cat /proc/sys/net/ipv4/ip_forward
1

So, ip forwarding should be enabled.

Inside the vps...

bash-2.05b# ip r a default via 191.255.255.1 dev venet0
RTNETLINK answers: Network is unreachable


I created an addition vps based on the centos template as you suggested.. networking works there.

[Updated on: Tue, 25 April 2006 17:47]

Report message to a moderator

Re: networking on LFS based distro [message #2904 is a reply to message #2897] Wed, 26 April 2006 06:12 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

ok. the full routing setup in my VPS looks like:

ip link set dev lo up
ip addr add 127.0.0.1/8 brd 127.255.255.255 dev lo scope host label lo
ip route replace 127.0.0.0/8 dev lo
ip route replace 169.254.0.0/16 dev lo
ip link set dev venet0 up
ip addr add 127.0.0.1/32 brd 0.0.0.0 dev venet0 scope host label venet0
ip route replace 169.254.0.0/16 dev venet0
ifconfig venet0:0 192.168.3.250 netmask 255.255.255.255 broadcast 192.168.3.250
route add default gw 191.255.255.1 venet0:0
ip route add 191.255.255.0/24 dev venet0 scope host
ip route add default via 191.255.255.1


where 192.168.3.250 is my VPS IP.
191.255.255.1 is fake address.

can you try doing this in VPS, from scratch, after all routes/addresses flush?


http://static.openvz.org/userbars/openvz-developer.png

[Updated on: Wed, 26 April 2006 06:13]

Report message to a moderator

Re: networking on LFS based distro [message #2913 is a reply to message #2904] Wed, 26 April 2006 18:05 Go to previous messageGo to next message
liamr is currently offline  liamr
Messages: 10
Registered: April 2006
Junior Member
I can do all of the "ip route" commands, but not not the "route add default gw". It returns "SIOCADDRT: Network is unreachable".

So, I tried stepping through the commands you provided.

I can do the "router add default gw" after I do..

ip route add 191.255.255.0/24 dev venet0 scope host

My routing table then looks like..

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
191.255.255.0 * 255.255.255.0 U 0 0 0 venet0
169.254.0.0 * 255.255.0.0 U 0 0 0 lo
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 191.255.255.1 0.0.0.0 UG 0 0 0 venet0

and I can see the outside world
*SOLVED* networking on LFS based distro [message #2960 is a reply to message #2882] Wed, 03 May 2006 19:35 Go to previous message
liamr is currently offline  liamr
Messages: 10
Registered: April 2006
Junior Member
I had to make some changes to my /etc/sysconfig/vz-scripts/dists/scripts/lfs-add_ip.sh script. Our distro isn't set up to use /sbin/ip.. we use the traditional ifconfig and route.

So... I changed the contents of /etc/sysconfig/network-devices/route.venet0 to...

route add -net 191.255.255.0/24 dev venet0
route add default gw 191.255.255.1 dev venet0

and then altered out /etc/rc.d/init.d/network to source that file instead of trying it's normal method of setting up the routing.

Anyhoo... looks like it's working now.
Previous Topic: vzmigrate
Next Topic: FC5 + 3ware raid
Goto Forum:
  


Current Time: Sat Aug 10 04:22:35 GMT 2024

Total time taken to generate the page: 0.02882 seconds