Changes between Version 3 and Version 4 of NetworkingSteps


Ignore:
Timestamp:
Jan 2, 2011, 5:46:40 PM (10 years ago)
Author:
stappers
Comment:

host network reconfigure for qemu

Legend:

Unmodified
Added
Removed
Modified
  • NetworkingSteps

    v3 v4  
    8282}}}
    8383
    84 Checking the host computer network configuration starts no with these commands
     84Checking the host computer network configuration starts now with these commands
    8585{{{
    8686/sbin/ifconfig eth0
     
    104104Your desktop computer is now in two IPv4 networks.
    105105
     106Now almost the same thing for {{{qemu}}},
     107it uses {{{tun/tap devices}}} and {{{network bridges}}}.
     108You need the packages {{{uml-utilities}}} and {{{bridge-utils}}}
     109{{{
     110sudo aptitude install uml-utilities bridge-utils
     111}}}
     112
     113Execute the next commands '''as root'''
     114{{{
     115modprobe tun
     116tunctl -u stappers -t tap0
     117ifconfig tap0 0.0.0.0
     118brctl addbr br0
     119brctl addif br0 tap0
     120ifconfig eth0 0.0.0.0
     121brctl addif br0 eth0
     122ifconfig br0 172.24.0.24 netmask 255.255.255.192
     123ifconfig br0:1 192.168.1.2 netmask 255.255.255.0
     124}}}
     125Some remarks:
     126* It is wise to put those commands in a shell script.
     127* The {{{tunctl}}} with {{{-u stappers}}} means that ''user stappers'' becomes owner of the tap device, it is the ''user'' that will start {{{qemu}}}.
     128
     129A succesfull setup will '''look like'''
     130{{{
     131# ifconfig br0
     132br0       Link encap:Ethernet  HWaddr 00:22:15:fd:e4:13 
     133          inet addr:172.24.0.24  Bcast:172.24.0.63  Mask:255.255.255.192
     134          inet6 addr: fe80::222:15ff:fefd:e413/64 Scope:Link
     135          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     136          RX packets:181786 errors:0 dropped:0 overruns:0 frame:0
     137          TX packets:35089 errors:0 dropped:0 overruns:0 carrier:0
     138          collisions:0 txqueuelen:0
     139          RX bytes:243452147 (232.1 MiB)  TX bytes:3080820 (2.9 MiB)
     140
     141# ifconfig br0:1
     142br0:1     Link encap:Ethernet  HWaddr 00:22:15:fd:e4:13 
     143          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
     144          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     145
     146# brctl show
     147bridge name     bridge id               STP enabled     interfaces
     148br0             8000.002215fde413       no              eth0
     149                                                        tap0
     150# brctl showmacs br0
     151port no mac addr                is local?       ageing timer
     152  2     00:1f:3f:f3:a6:25       no               107.20
     153  2     00:22:15:fd:e4:13       yes                0.00
     154  1     52:54:00:12:34:56       no               119.66
     155  2     52:55:0a:00:02:02       no               111.52
     156  1     f6:ec:e6:54:6d:5a       yes                0.00
     157#
     158}}}
     159That is all from the host computer, the machine that will run {{{qemu}}}.
     160
     161You start {{{qemu}}} with
     162{{{
     163qemu-system-mipsel -M malta -nographic \
     164  -kernel /usr/src/debwrt/build/openwrt-malta-le_Default-trunk-default/build_dir/linux-malta_le/vmlinux.elf \
     165  -hda /usr/src/debwrt/tile -parallel none -m 256 \
     166  -net user -net nic,model=pcnet \
     167  -net tap,ifname=tap0 \
     168  -append "root=/dev/sda1 probe_mask=0x3f init=/sbin/init rootdelay=2 console=ttyS0,115200 netconsole=6665@192.168.1.1/eth0,6666@192.168.1.2/"
     169}}}
     170
     171From your configured host, either real or qemu,
     172you can now {{{secure shell}}} to your debwrt instance
     173{{{
     174ssh root@192.168.1.1
     175}}}
     176the default password is ''debwrt''
     177
    106178==== See Also ====
    107179