Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Postawilem sobie testowo lxc debiana, wszystko poszlo bez problemow ale nie moge skonfigurowac dostepu do neta.
Wyglada to mniej wiecej tak:
1. Jest sobie postawiony Debian na KVM z przydzielonym statycznym IP - tutaj jest jest dostep do internetu
auto br0 iface br0 inet static bridge_ports eth0 bridge_fd 0 address 192.168.122.110 netmask 255.255.255.0 gateway 192.168.122.1 dns-nameservers 192.168.122.1
2. config kontenera wyglada tak:
lxc.tty = 4 lxc.pts = 1024 lxc.rootfs = /var/lib/lxc/vm0/rootfs lxc.cgroup.devices.deny = a # /dev/null and zero lxc.cgroup.devices.allow = c 1:3 rwm lxc.cgroup.devices.allow = c 1:5 rwm # consoles lxc.cgroup.devices.allow = c 5:1 rwm lxc.cgroup.devices.allow = c 5:0 rwm lxc.cgroup.devices.allow = c 4:0 rwm lxc.cgroup.devices.allow = c 4:1 rwm # /dev/{,u}random lxc.cgroup.devices.allow = c 1:9 rwm lxc.cgroup.devices.allow = c 1:8 rwm lxc.cgroup.devices.allow = c 136:* rwm lxc.cgroup.devices.allow = c 5:2 rwm # rtc lxc.cgroup.devices.allow = c 254:0 rwm # mounts point lxc.mount.entry=proc /var/lib/lxc/vm0/rootfs/proc proc nodev,noexec,nosuid 0 0 lxc.mount.entry=devpts /var/lib/lxc/vm0/rootfs/dev/pts devpts defaults 0 0 lxc.mount.entry=sysfs /var/lib/lxc/vm0/rootfs/sys sysfs defaults 0 0 # Konfiguracja kontenera vm0 lxc.utsname = vm0 lxc.network.type = veth lxc.network.flags = up lxc.network.link = br0 lxc.network.ipv4 = 192.168.122.111/24
3. Konfiguracja /var/lib/lxc/vm0/rootfs/etc/network/interfaces
iface eth0 inet static address 192.168.122.111 netmask 255.255.255.0 network 192.168.122.0 broadcast 192.168.122.255 gateway 192.168.122.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 192.168.122.1
I tu juz niestety kontener niema dostepu do internetu
jak np. chce zainstalowac mc to dostaje:
vm0:~# apt-get install mc Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: libglib2.0-0 libglib2.0-data libgpm2 libpcre3 Suggested packages: gpm mime-support zip unzip bzip2 links w3m lynx arj file xpdf dbview odt2txt The following NEW packages will be installed: libglib2.0-0 libglib2.0-data libgpm2 libpcre3 mc 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 3959kB of archives. After this operation, 11.6MB of additional disk space will be used. Do you want to continue [Y/n]? WARNING: The following packages cannot be authenticated! libgpm2 libpcre3 libglib2.0-0 libglib2.0-data mc Install these packages without verification [y/N]? y Err http://ftp.debian.org lenny/main libgpm2 1.20.4-3.1 Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Err http://ftp.debian.org lenny/main libpcre3 7.6-2.1 Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Err http://ftp.debian.org lenny/main libglib2.0-0 2.16.6-3 Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Err http://ftp.debian.org lenny/main libglib2.0-data 2.16.6-3 Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Err http://ftp.debian.org lenny/main mc 2:4.6.2~git20080311-4 Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Failed to fetch http://ftp.debian.org/debian/pool/main/g/gpm/libgpm2_1.20.4-3.1_amd64.deb Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Failed to fetch http://ftp.debian.org/debian/pool/main/p/pcre3/libpcre3_7.6-2.1_amd64.deb Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Failed to fetch http://ftp.debian.org/debian/pool/main/g/glib2.0/libglib2.0-0_2.16.6-3_amd64.deb Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Failed to fetch http://ftp.debian.org/debian/pool/main/g/glib2.0/libglib2.0-data_2.16.6-3_all.deb Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] Failed to fetch http://ftp.debian.org/debian/pool/main/m/mc/mc_4.6.2~git20080311-4_amd64.deb Cannot initiate the connection to ftp.debian.org:80 (130.89.149.226). - connect (101 Network is unreachable) [IP: 130.89.149.226 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Nie dziala tylko dostep do internetu mozna natomiast bez problemu spingowac z hosta (192.168.122.110) kontener (192.168.122.111).
Ma ktos pomysl jak uruchomic dostep do internetu na kontenerze?
Z tego co widac pluje sie o DNS ale na kontenerze (vm0) jest ustawiony taki sam DNS jak na hoscie wiec nie bardzo wiem o co mu chodzi...
Ostatnio edytowany przez debianus_userus (2011-02-08 17:56:05)
Offline