Options

How do you simulate hosts on a network?

ehndeehnde Member Posts: 1,103
With dynamips, how do you simulate hosts on a network? Like having a router with 10.0.0.0/32 and two hosts - 10.0.0.101 and 10.0.0.100. Loopback maybe?

I was trying to set up qemu hosts and it has turned out to be a waste of time. No luck.

Going to bed, my brain is fried.
Climb a mountain, tell no one.

Comments

  • Options
    darkerzdarkerz Member Posts: 431 ■■■■□□□□□□
    Hosts.. I believe using that terminology implies actual host clients, end-user devices connected to said router?

    If that's the case, I... *Looks at Int0/0, looks at ethernet cord for laptop, 1+1=* I don't understand? o.O

    It's late. I'm going to bed as well.

    *Stares at 2600 2611 XM router. It's taunting me*
    :twisted:
  • Options
    mattaumattau Member Posts: 218
    if you want to do the loopback option then you will need an ios that has the ping ip x.x.x.x source x.x.x.x / trace command so you can mimic being the host. took me ages to figure that out :)
    _____________________________________
    CCNP ROUTE - passed 20/3/12
    CCNP SWITCH - passed 25/10/12
    CCNP TSHOOT - passed 11/12/12




  • Options
    stuh84stuh84 Member Posts: 503
    ehnde wrote: »
    With dynamips, how do you simulate hosts on a network? Like having a router with 10.0.0.0/32 and two hosts - 10.0.0.101 and 10.0.0.100. Loopback maybe?

    I was trying to set up qemu hosts and it has turned out to be a waste of time. No luck.

    Going to bed, my brain is fried.

    Various different ways, I'll put them from easiest to hardest

    1) loopbacks - least functionality, but will prove connectivity
    2) another router - more functionality, although most CLI based obviously so can't easily prove things like web traffic and the like
    3) setting up a host in VirtualBox - about the best solution

    For the 3rd option, here's what I do to get it connected

    Get hold of the tunctl and bridge-utils packages if you haven't got them already (yum install tunctl or sudo apt-get install tunctl etc). If those aren't the package names, then just do a quick apt-cache search for tunctl or yum search.

    Once I get these, I just do sudo tunctl -t tap0 to create a tap interface, then ifconfig tap0 up to bring it up. Do this for every tap interface you want to use (either more hosts, or more interfaces per host)

    Go into VirtualBox, with the VM I prepared earlier (usually a linux host), and change the network settings to use a Bridged Adapter, and tell it to use tap0 as that adapter.

    In Dynamips do this under your router

    e0/0 = NIO_tap:tap0

    Change the interface based upon what type of router (7200, 3640, whatever you are using).

    Then you just configure IPs and they should be reachable from each other.

    As a bonus, if you are using a Linux host, add a default route to the router its connected to with "route add default gw [IP of routers interface] eth0", replace eth0 with whatever interface is in "ifconfig" on the Linux host.

    I do use Qemu with Dynamips too, but I tend to use Qemu for things like Juniper and Vyatta emulation.
    Work In Progress: CCIE R&S Written

    CCIE Progress - Hours reading - 15, hours labbing - 1
  • Options
    ehndeehnde Member Posts: 1,103
    mattau wrote: »
    if you want to do the loopback option then you will need an ios that has the ping ip x.x.x.x source x.x.x.x / trace command so you can mimic being the host. took me ages to figure that out :)

    I hadn't come across this command yet. In face I'd never thought to do ping ? to see what other options there were icon_lol.gif

    What is this trace command? Do you mean traceroute? Since I don't need any advanced IP functionality I could give this a shot.

    The reason I'm doing it is by default routers have to be connected to different networks on each interface (right?), resulting in the need for "hosts" in one form or another.
    Climb a mountain, tell no one.
  • Options
    ehndeehnde Member Posts: 1,103
    stuh84 wrote: »
    Various different ways, I'll put them from easiest to hardest

    1) loopbacks - least functionality, but will prove connectivity
    2) another router - more functionality, although most CLI based obviously so can't easily prove things like web traffic and the like
    3) setting up a host in VirtualBox - about the best solution

    For the 3rd option, here's what I do to get it connected

    Get hold of the tunctl and bridge-utils packages if you haven't got them already (yum install tunctl or sudo apt-get install tunctl etc). If those aren't the package names, then just do a quick apt-cache search for tunctl or yum search.

    Once I get these, I just do sudo tunctl -t tap0 to create a tap interface, then ifconfig tap0 up to bring it up. Do this for every tap interface you want to use (either more hosts, or more interfaces per host)

    Go into VirtualBox, with the VM I prepared earlier (usually a linux host), and change the network settings to use a Bridged Adapter, and tell it to use tap0 as that adapter.

    In Dynamips do this under your router

    e0/0 = NIO_tap:tap0

    Change the interface based upon what type of router (7200, 3640, whatever you are using).

    Then you just configure IPs and they should be reachable from each other.

    As a bonus, if you are using a Linux host, add a default route to the router its connected to with "route add default gw [IP of routers interface] eth0", replace eth0 with whatever interface is in "ifconfig" on the Linux host.

    I do use Qemu with Dynamips too, but I tend to use Qemu for things like Juniper and Vyatta emulation.

    You know I could spend a whole day trying to digest all of this. Mostly I get it, but the configuration involved with tunctl and the like..... icon_lol.gif Inevitably I'll give it a shot! It's probably easy once you've done it a few times, I'm sure.

    In your emulation adventures, have you ever used Microcore Linux 3.4 Qemu image available at gns3.net/downloads ? I couldn't find any docs on it, but figured it was a very lightweight host with maximum networking functionality.

    I'm going to search for relevant tutorials on hacki.at.
    Climb a mountain, tell no one.
  • Options
    stuh84stuh84 Member Posts: 503
    ehnde wrote: »
    You know I could spend a whole day trying to digest all of this. Mostly I get it, but the configuration involved with tunctl and the like..... icon_lol.gif Inevitably I'll give it a shot! It's probably easy once you've done it a few times, I'm sure.

    In your emulation adventures, have you ever used Microcore Linux 3.4 Qemu image available at gns3.net/downloads ? I couldn't find any docs on it, but figured it was a very lightweight host with maximum networking functionality.

    I'm going to search for relevant tutorials on hacki.at.

    The tunctl part is easy, its just a case of creating a tap interface, and then bringing the interface up, beyond that you dont do anything.

    As far as Microcore, I've not touched it, I'm a Linux guy as it is so I just would rather do things my way, hence I build my own VMs to do the job.
    Work In Progress: CCIE R&S Written

    CCIE Progress - Hours reading - 15, hours labbing - 1
  • Options
    bermovickbermovick Member Posts: 1,135 ■■■■□□□□□□
    Stuh, have you encountered the duplicate packet issue? I've been working on getting virtual hosts integrated with gns3, using virtualbox, and that seems to be the only issue I'm encountering, both with bridged tap interfaces and host-only adapters.
    debian-2:/etc# ping 192.168.3.2
    PING 192.168.3.2 (192.168.3.2) 56(84) bytes of data.
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.497 ms
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.519 ms (DUP!)
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.523 ms (DUP!)
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.534 ms (DUP!)
    ^C
    
    Latest Completed: CISSP

    Current goal: Dunno
  • Options
    stuh84stuh84 Member Posts: 503
    bermovick wrote: »
    Stuh, have you encountered the duplicate packet issue? I've been working on getting virtual hosts integrated with gns3, using virtualbox, and that seems to be the only issue I'm encountering, both with bridged tap interfaces and host-only adapters.
    debian-2:/etc# ping 192.168.3.2
    PING 192.168.3.2 (192.168.3.2) 56(84) bytes of data.
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.497 ms
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.519 ms (DUP!)
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.523 ms (DUP!)
    64 bytes from 192.168.3.2: icmp_seq=1 ttl=64 time=0.534 ms (DUP!)
    ^C
    

    Not that I've seen, that does sound a bit strange. What version of VB are you using? Also, could you post the relevant part/parts of the net file? I wonder if this another issue with GNS3's implementation compared to Dynamips.
    Work In Progress: CCIE R&S Written

    CCIE Progress - Hours reading - 15, hours labbing - 1
  • Options
    bermovickbermovick Member Posts: 1,135 ■■■■□□□□□□
    Sorry to take so long getting back; I had a 2nd interview for a NOC tier 1 position today.

    I recreated a simple flat network with a router providing DHCP service and a dumb switch connecting the 3 devices (cloudA, cloudB, 3725 router). Since I'm not sure what parts of the net file are relevant, here's the entire thing.
    autostart = False
    [127.0.0.1:7200]
        workingdir = working
        udp = 10000
        [[3725]]
            image = /home/talon/c3725-entbase-mz.124-5.bin
            ram = 128
            idlepc = 0x60759590
            ghostios = True
        [[ETHSW SW1]]
            1 = access 1 nio_linux_eth:tap0
            2 = access 1 nio_linux_eth:tap1
            3 = access 1 R1 f0/0
            x = -64.5
            y = 13.0
        [[ROUTER R1]]
            model = 3725
            console = 2000
            f0/0 = SW1 3
            x = -53.0
            y = 124.0
    [GNS3-DATA]
        configs = configs
        workdir = working
        [[NOTE 1]]
            text = f0/0
            x = 29.9321400446
            y = -17.8821794201
            interface = R1 f0/0
            color = "#181615"
        [[NOTE 2]]
            text = nio_linux_eth:tap1
            x = 34.6893243678
            y = 74.8999166588
            interface = C2 nio_linux_eth:tap1
            color = "#181615"
        [[Cloud C2]]
            x = 37.5
            y = -136.0
            connections = SW1:2:nio_linux_eth:tap1
        [[NOTE 3]]
            text = nio_linux_eth:tap0
            x = 138.611874134
            y = 72.493817308
            interface = C1 nio_linux_eth:tap0
            color = "#181615"
        [[Cloud C1]]
            x = -283.5
            y = -117.0
            connections = SW1:1:nio_linux_eth:tap0
        [[NOTE 4]]
            text = 3
            x = 38.5678599554
            y = 55.8821794201
            interface = SW1 3
            color = "#181615"
        [[NOTE 5]]
            text = 2
            x = 65.3737837548
            y = -10.5999444392
            interface = SW1 2
            color = "#181615"
        [[NOTE 6]]
            text = 1
            x = 1.72178620896
            y = -5.42503846174
            interface = SW1 1
            color = "#181615"
    

    From my googling, it's an issue with Virtualbox (I'm using 3.2.12_OSE r68302, from debian unstable repository).
    Latest Completed: CISSP

    Current goal: Dunno
Sign In or Register to comment.