From: xpto09 <xp...@gm...> - 2006-04-24 01:49:49
|
I said: > To run root_fs: > ./linux-2.6.16 rw eth0=3Dslirp,,/usr/bin/slirp Blaisorblade said: > That is fine, but is uncommon and maybe slower... However, if it's ok for you > don't worry... indeed it's the setup with less parameters. So I tried run with tun/tap. (kernel and root are from Jeff' site) Why can I ping the host from uml? # modprobe -v tun insmod /lib/modules/2.6.14-kanotix-6/kernel/drivers/net/tun.ko # tunctl -u root Set 'tap0' persistent and owned by uid 0 # ifconfig eth0 Encapsulamento do Link: Ethernet Endere=E7o de HW 00:50:FC:B3:8C:C5 inet end.: 201.12.138.45 Bcast:255.255.255.255 Masc: 255.255.254.0 endere=E7o inet6: fe80::250:fcff:feb3:8cc5/64 Escopo:Link UP BROADCASTRUNNING MULTICAST MTU:1500 M=E9trica:1 RX packets:31008 errors:0 dropped:0 overruns:0 frame:0 TX packets:3745 errors:0 dropped:0 overruns:0 carrier:0 colis=F5es:0 txqueuelen:1000 RX bytes:4692452 (4.4 MiB) TX bytes:647393 ( 632.2 KiB) IRQ:10 lo Encapsulamento do Link: Loopback Local inet end.: 127.0.0.1 Masc:255.0.0.0 endere=E7o inet6: ::1/128 Escopo:M=E1quina UP LOOPBACKRUNNING MTU:16436 M=E9trica:1 RX packets:8188 errors:0 dropped:0 overruns:0 frame:0 TX packets:8188 errors:0 dropped:0 overruns:0 carrier:0 colis=F5es:0 txqueuelen:0 RX bytes:636538 (621.6 KiB) TX bytes:636538 (621.6 KiB) #ifconfig tap0 192.168.0.253 #bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' #route add -host 192.168.0.254 dev tap0 #bash -c 'echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp' #arp -Ds 192.168.0.254 eth0 pub #chmod 666 /dev/net/tun #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # ifconfig eth0 Encapsulamento do Link: Ethernet Endere=E7o de HW 00:50:FC:B3:8C:C5 inet end.: 201.12.138.45 Bcast:255.255.255.255 Masc: 255.255.254.0 endere=E7o inet6: fe80::250:fcff:feb3:8cc5/64 Escopo:Link UP BROADCASTRUNNING MULTICAST MTU:1500 M=E9trica:1 RX packets:60067 errors:0 dropped:0 overruns:0 frame:0 TX packets:4981 errors:0 dropped:0 overruns:0 carrier:0 colis=F5es:0 txqueuelen:1000 RX bytes:7736782 (7.3 MiB) TX bytes:800643 ( 781.8 KiB) IRQ:10 lo Encapsulamento do Link: Loopback Local inet end.: 127.0.0.1 Masc:255.0.0.0 endere=E7o inet6: ::1/128 Escopo:M=E1quina UP LOOPBACKRUNNING MTU:16436 M=E9trica:1 RX packets:8188 errors:0 dropped:0 overruns:0 frame:0 TX packets:8188 errors:0 dropped:0 overruns:0 carrier:0 colis=F5es:0 txqueuelen:0 RX bytes:636538 (621.6 KiB) TX bytes:636538 (621.6 KiB) tap0 Encapsulamento do Link: Ethernet Endere=E7o de HW 06:AA:1E:C9:3E:3B inet end.: 192.168.0.253 Bcast:192.168.0.255 Masc:255.255.255.= 0 endere=E7o inet6: fe80::4aa:1eff:fec9:3e3b/64 Escopo:Link UP BROADCASTRUNNING MULTICAST MTU:1500 M=E9trica:1 RX packets:15 errors:0 dropped:0 overruns:0 frame:0 TX packets:14 errors:0 dropped:91 overruns:0 carrier:0 colis=F5es:0 txqueuelen:500 RX bytes:1414 (1.3 KiB) TX bytes:2265 ( 2.2 KiB) # ./linux-2.6.16 eth0=3Dtuntap,tap0 [root@localhost ~]# ifconfig eth0 192.168.0.254 up [root@localhost ~]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr FE:FD:C0:A8:00:FE inet addr:192.168.0.254 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST 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:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:5 [root@localhost ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 * 255.255.255.0 U 0 0 0 eth= 0 [root@localhost ~]# ping 192.168.0.253 PING 192.168.0.253 ( 192.168.0.253) 56(84) bytes of data. --- 192.168.0.253 ping statistics --- 14 packets transmitted, 0 received, 100% packet loss, time 13232ms Marcos |
From: Stefano M. <ste...@op...> - 2006-04-24 07:03:52
|
On Sun, Apr 23, 2006 at 10:49:44PM -0300, xpto09 wrote: hi, >=20 > So I tried run with tun/tap. >=20 > (kernel and root are from Jeff' site) >=20 > Why can I ping the host from uml? >=20 >=20 > # modprobe -v tun > insmod /lib/modules/2.6.14-kanotix-6/kernel/drivers/net/tun.ko >=20 > # tunctl -u root > Set 'tap0' persistent and owned by uid 0 >=20 my configuration is: Host side: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # tap0 iface tap0 inet static address 10.0.0.15 network 10.0.0.0 netmask 255.255.255.0 pre-up tunctl -u stex pre-up bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' pre-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE post-down tunctl -d stex Uml side: =3D=3D=3D=3D=3D=3D=3D=3D=3D auto eth0 iface eth0 inet static address 10.0.0.10 network 10.0.0.0 netmask 255.255.255.0 up route add -net 0.0.0.0 dev eth0 up route add -net 0.0.0.0 gw 212.34.199.38 dns-nameservers 212.34.194.168 212.34.194.211 Consider that the last couple of line refer to the fact that I need to go outside my host box, so for your purpose you don't need them. I can do whatever I would like with this conf. Thank you SteX --=20 Stefano Melchior, GPG key =3D D52DF829 - <ste...@op...> http://etinarcadiaego.dyndns.org -- http://www.stex.name Skype ID "stefanomelchior" |
From: xpto09 <xp...@gm...> - 2006-04-25 00:42:20
|
On 4/24/06, Stefano Melchior <ste...@op...> wrote: > > > my configuration is: > > Host side: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > # tap0 > iface tap0 inet static > address 10.0.0.15 > network 10.0.0.0 > netmask 255.255.255.0 > pre-up tunctl -u stex > pre-up bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' > pre-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > post-down tunctl -d stex I got to put in /etc/network/interfaces the command that you have, $ cat /etc/network/interfaces # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # The loopback interface # automatically added when upgrading auto lo eth0 iface lo inet loopback iface eth0 inet dhcp #Added to test uml: auto tap0 iface tap0 inet static address 10.0.0.15 network 10.0.0.0 netmask 255.255.255.0 On my host: ~$ route -n Tabela de Roteamento IP do Kernel Destino Roteador M=E1scaraGen. Op=E7=F5es M=E9trica Ref = Uso Iface 10.0.52.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.16.71.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet8 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 tap0 172.16.94.0 0.0.0.0 255.255.255.0 U 0 0 0 vmnet1 0.0.0.0 10.0.52.254 0.0.0.0 UG 0 0 0 eth0 Uml side: > =3D=3D=3D=3D=3D=3D=3D=3D=3D > auto eth0 > iface eth0 inet static > address 10.0.0.10 > network 10.0.0.0 > netmask 255.255.255.0 > up route add -net 0.0.0.0 dev eth0 > up route add -net 0.0.0.0 gw 212.34.199.38 > dns-nameservers 212.34.194.168 212.34.194.211 > > Consider that the last couple of line refer to the fact that I need to go > outside my host box, so for your purpose you don't need them. > I can do whatever I would like with this conf. However, the Fedora do not has the /etc/network/interfaces. I create this file, nothing happened. How do I put the commands below? |
From: Blaisorblade <bla...@ya...> - 2006-04-26 17:05:45
|
On Tuesday 25 April 2006 02:42, xpto09 wrote: > On 4/24/06, Stefano Melchior <ste...@op...> wrote: > > my configuration is: > > > > Host side: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > # tap0 > > iface tap0 inet static > > address 10.0.0.15 > > network 10.0.0.0 > > netmask 255.255.255.0 > > pre-up tunctl -u stex > > pre-up bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward' > > pre-up iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > > post-down tunctl -d stex > > I got to put in /etc/network/interfaces the command that you have, > > $ cat /etc/network/interfaces > # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) > > # The loopback interface > # automatically added when upgrading > auto lo eth0 > iface lo inet loopback > > iface eth0 inet dhcp > > #Added to test uml: > auto tap0 > iface tap0 inet static > address 10.0.0.15 > network 10.0.0.0 > netmask 255.255.255.0 > > On my host: > ~$ route -n > Tabela de Roteamento IP do Kernel > Destino Roteador M=E1scaraGen. Op=E7=F5es M=E9trica Ref= Uso > Iface > 10.0.52.0 0.0.0.0 255.255.255.0 U 0 0 0 > eth0 > 172.16.71.0 0.0.0.0 255.255.255.0 U 0 0 0 > vmnet8 > 10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 > tap0 > 172.16.94.0 0.0.0.0 255.255.255.0 U 0 0 0 > vmnet1 > 0.0.0.0 10.0.52.254 0.0.0.0 UG 0 0 > 0 eth0 > > Uml side: > > =3D=3D=3D=3D=3D=3D=3D=3D=3D > > auto eth0 > > iface eth0 inet static > > address 10.0.0.10 > > network 10.0.0.0 > > netmask 255.255.255.0 > > up route add -net 0.0.0.0 dev eth0 The below two aren't appropriate for this case > > up route add -net 0.0.0.0 gw 212.34.199.38 > > dns-nameservers 212.34.194.168 212.34.194.211 > > > > Consider that the last couple of line refer to the fact that I need to = go > > outside my host box, so for your purpose you don't need them. > > I can do whatever I would like with this conf. > > However, the Fedora do not has the /etc/network/interfaces. > I create this file, nothing happened. > How do I put the commands below? =46edora configures the interfaces through /etc/sysconfig/network* (in=20 particular ifcfg-*), however you'd better try for now doing it by hand via= =20 ifconfig eth0 10.0.0.10 netmask 255.255.255.0 and (if you want, for host access): route add default gw 10.0.0.15 (which isn't in the setup supplied by Stefano) - it sets the host as defaul= t=20 gateway. I took the host IP assigned to tap0. =2D-=20 Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade Chiacchiera con i tuoi amici in tempo reale! http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com |
From: xpto09 <xp...@gm...> - 2006-04-27 01:35:17
|
> > Fedora configures the interfaces through /etc/sysconfig/network* (in > particular ifcfg-*), however you'd better try for now doing it by hand vi= a > ifconfig eth0 10.0.0.10 netmask 255.255.255.0 > > and (if you want, for host access): > route add default gw 10.0.0.15 > (which isn't in the setup supplied by Stefano) - it sets the host as > default > gateway. I took the host IP assigned to tap0. Thanks. Now works. Marcos |
From: Stefano M. <ste...@op...> - 2006-04-27 06:33:06
|
On Wed, Apr 26, 2006 at 07:05:12PM +0200, Blaisorblade wrote: Dear all, > The below two aren't appropriate for this case > > > up route add -net 0.0.0.0 gw 212.34.199.38 > > > dns-nameservers 212.34.194.168 212.34.194.211 sorry, the last two line refer to my ISP's DNSes and my public IP ... obviously you won't need them in your own configuration. >=20 > > > > > > Consider that the last couple of line refer to the fact that I need t= o go > > > outside my host box, so for your purpose you don't need them. > > > I can do whatever I would like with this conf. > > > > However, the Fedora do not has the /etc/network/interfaces. > > I create this file, nothing happened. > > How do I put the commands below? > Fedora configures the interfaces through /etc/sysconfig/network* (in=20 > particular ifcfg-*), however you'd better try for now doing it by hand vi= a=20 > ifconfig eth0 10.0.0.10 netmask 255.255.255.0 right, another thing that I forgot to mention is the fact that I use Debian, so the configuration refers to this distro. Then you need to set your config fine up accordingly with your one. >=20 > and (if you want, for host access): > route add default gw 10.0.0.15 > (which isn't in the setup supplied by Stefano) - it sets the host as defa= ult=20 > gateway. I took the host IP assigned to tap0. Sorry for mistakes, anyway I hope it is clearer, now! SteX --=20 Stefano Melchior, GPG key =3D D52DF829 - <ste...@op...> http://etinarcadiaego.dyndns.org -- http://www.stex.name Skype ID "stefanomelchior" |
From: Blaisorblade <bla...@ya...> - 2006-04-24 15:21:50
|
On Monday 24 April 2006 03:49, xpto09 wrote: > I said: > > To run root_fs: > > ./linux-2.6.16 rw eth0=slirp,,/usr/bin/slirp > So I tried run with tun/tap. I was suggesting the use of the automatic configuration, at least as 1st step. Doing it by hand can be done subsequently. > (kernel and root are from Jeff' site) > > Why can I ping the host from uml? Ok, you mean "why _can't_ I ping the host from the UML". I'd check that it's not caused by host firewall rules, since the configuration seems otherwise correct. Please see if, after bringing up eth0 inside Uml, dmesg shows any message about that. The configuration in UML seems correct, you don't post the route table on the host but it should be fine, you've given the right commands. The only (little) error, is that you shouldn't use proxy ARP in your case, even if it shouldn't be the cause of this problem (that's done only when the UML has the same IP class than the host, and you're not doing that). -- Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!". Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894) http://www.user-mode-linux.org/~blaisorblade ___________________________________ Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive http://it.messenger.yahoo.com |