论坛升级后通告

论坛注册须知

NetEmu社区 FAQ

NetEmu招募新版主

企业IT架构选型选购与应用

中小企业轻松建网实操攻略

论坛强烈声明

广告招租QQ:1164258114

返回列表 回复 发帖
新版qemu,应该能支持bgp和ospf了(tcp和udp)。请大家测试。采用mmm123原文件部分代码。

内含bin文件,我的命令行,和原文件,替换qemu安装文件hw文件夹中同名文件再重新编译即可。
我是在2007-08-24版测试的,不知道在最新版上行不行。
qemu下载地址
http://qemu-forum.ipi.fi/qemu-snapshots/qemu-snapshot-2007-09-16_05.tar.bz2
附件: 您所在的用户组无法下载或查看附件
沙发。感谢。
我根据楼主提供的信息编译的Windows版本。供大家测试。

启动命令参考:
juniper.exe -L . -m 256 -hda E:\VMOS\juniper\junos8.3.vmdk -boot c -localtime -net nic,vlan=3,macaddr=00:aa:00:00:01:03,model=i82559er -net tap,vlan=3,ifname=tap2 -net nic,vlan=2,macaddr=00:aa:00:00:01:02,model=i82559er -net tap,vlan=2,ifname=tap1 -net nic,vlan=1,macaddr=00:aa:00:00:01:01,model=i82559er -net tap,vlan=1,ifname=tap0 -kernel-kqemu -serial [url=telnet::1007,server]telnet::1007,server[/url]


附件:
附件: 您所在的用户组无法下载或查看附件
倒,加了一个参数model=i82559er ,呵呵,刚开始没有看到,没有加,结果起动完了没有物理接口,一个都不在了。
呵呵,是的。这点改变忘了说了。
原帖由 myios 于 2007-9-17 11:16 发表
呵呵,是的。这点改变忘了说了。
老大,命令行的tap网卡和Juniper的网卡对应次序不对了,能不能修改一下这个问题?
测试了一下,BGP 邻居建立确实没有问题了,但是LDP session好象还是不行的。
root> show bgp summary logical-router ce1  
Groups: 2 Peers: 2 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
inet.0                 1          0          0          0          0          0
Peer               AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Damped...
192.255.197.17    300         15         20       0       0        6:38 Establ
  inet.0: 0/1/0
10.255.255.177    200          7          8       0       0        5:35 Establ
  inet.0: 0/0/0
root>
root>
root>
root>
root> show bgp neighbor logical-router ce1
Peer: 192.255.197.17+179 AS 300 Local: 192.255.197.18+1997 AS 200  
  Type: External    State: Established    Flags: <ImportEval Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Export: [ internal ]
  Options: <Preference HoldTime AddressFamily PeerAS Refresh>
  Address families configured: inet-labeled-unicast
  Holdtime: 180 Preference: 170
  Number of flaps: 0
  Peer ID: 192.255.197.17   Local ID: 10.255.255.179   Active Holdtime: 90
  Keepalive Interval: 30         Peer index: 0   
  Local Interface: fxp1.45                          
  NLRI advertised by peer: inet-labeled-unicast
  NLRI for this session: inet-labeled-unicast
  Peer supports Refresh capability (2)
  Table inet.0 Bit: 10000
    RIB State: BGP restart is complete
    Send state: in sync
    Active prefixes:              0
    Received prefixes:            1
    Suppressed due to damping:    0
    Advertised prefixes:          6
  Last traffic (seconds): Received 13   Sent 24   Checked 24  
  Input messages:  Total 15     Updates 1       Refreshes 0     Octets 321
  Output messages: Total 20     Updates 5       Refreshes 0     Octets 638
  Output Queue[0]: 0
Peer: 10.255.255.177+3217 AS 200 Local: 10.255.255.179+179 AS 200  
  Type: Internal    State: Established    Flags: <ImportEval Sync>
  Last State: OpenConfirm   Last Event: RecvKeepAlive
  Last Error: None
  Options: <Preference LocalAddress HoldTime AddressFamily Refresh>
  Address families configured: inet-labeled-unicast
  Local Address: 10.255.255.179 Holdtime: 180 Preference: 170
  Number of flaps: 0
  Peer ID: 10.255.255.177   Local ID: 10.255.255.179   Active Holdtime: 180
  Keepalive Interval: 60         Peer index: 0   
  NLRI advertised by peer: inet-labeled-unicast
  NLRI for this session: inet-labeled-unicast
  Peer supports Refresh capability (2)
  Table inet.0 Bit: 10001
    RIB State: BGP restart is complete
    Send state: in sync
    Active prefixes:              0
    Received prefixes:            0
    Suppressed due to damping:    0
    Advertised prefixes:          0
  Last traffic (seconds): Received 40   Sent 40   Checked 40  
  Input messages:  Total 7      Updates 0       Refreshes 0     Octets 159
  Output messages: Total 8      Updates 0       Refreshes 0     Octets 178
  Output Queue[0]: 0
root>

root> show ldp neighbor logical-router p2  
Address            Interface          Label space ID         Hold time
192.255.198.1      fxp1.34            10.255.255.179:0         11
192.255.198.9      fxp2.23            10.255.255.177:0         10

root> show ldp session logical-router p2
  Address           State        Connection     Hold time
10.255.255.177      Operational  Open             20
10.255.255.179      Operational  Open             20
root>
root> show ldp session detail logical-router p2
Address: 10.255.255.177, State: Operational, Connection: Open, Hold time: 21
  Session ID: 10.255.255.175:0--10.255.255.177:0
  Next keepalive in 1 seconds
  Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1
  Keepalive interval: 10, Connect retry interval: 1
  Local address: 10.255.255.175, Remote address: 10.255.255.177
  Up for 00:07:11
  Local - Restart: disabled, Helper mode: enabled
  Remote - Restart: disabled, Helper mode: enabled
  Local maximum recovery time: 240000 msec
  Next-hop addresses received:
    192.255.198.9
Address: 10.255.255.179, State: Operational, Connection: Open, Hold time: 21
  Session ID: 10.255.255.175:0--10.255.255.179:0
  Next keepalive in 1 seconds
  Passive, Maximum PDU: 4096, Hold time: 30, Neighbor count: 1
  Keepalive interval: 10, Connect retry interval: 1
  Local address: 10.255.255.175, Remote address: 10.255.255.179
  Up for 00:07:11
  Local - Restart: disabled, Helper mode: enabled
  Remote - Restart: disabled, Helper mode: enabled
  Local maximum recovery time: 240000 msec
  Next-hop addresses received:
    192.255.198.1
root>

总的来说还是有很不错的呀,BGP可以正常使用了。期待myios能对LDP的问题抽空再看看。
不知道坛子里其他人有没有LDP session正常的?
原帖由 ronsun 于 2007-9-17 11:37 发表

老大,命令行的tap网卡和Juniper的网卡对应次序不对了,能不能修改一下这个问题?
就是不对应,和以前的版本又变了,起动起来发现直连之间不通,结果一看物理接口和脚本不一直,没办法,修改,重起。这是我的脚本:

juniper.exe -L . -m 256 -hda ..\images\oliver.vmdk -boot c -localtime  -net nic,vlan=2,macaddr=00:aa:00:00:01:01,model=i82559er  -net tap,vlan=2,ifname=tap0 -net nic,vlan=3,macaddr=00:aa:00:00:01:02,model=i82559er  -net tap,vlan=3,ifname=tap1 -net nic,vlan=3,macaddr=00:aa:00:00:01:03,model=i82559er  -net tap,vlan=3,ifname="tap2" -serial [url=telnet::2020,server,nowait]telnet::2020,server,nowait[/url]
pause
哦。ldp是基于tcp的吗?我对这个不是很清楚。
恩,是的,LDP协议的hello报文是UDP发送的,通过发送hello报文,发现邻居,然后使用TCP建立session,LDP协议TCP和UDP都使用。
myios,不好意思,我弄错了,LDP没有问题。
伟大的进展,看起来能做MPLS VPN了
原帖由 wanzxj 于 2007-9-17 12:32 发表
myios,不好意思,我弄错了,LDP没有问题。
把你的配置贴出来看看哈。thank you .
不知道怎么感谢MYISO才好呀,问题觉得解决了!很多的试验都可以很方便地进行啦,哈哈。

我的BGP & OSPF CONFIGURATION:

root> show configuration
## Last commit: 2007-09-17 13:26:15 UTC by root
version 8.3R2.8;
system {
    root-authentication {
        encrypted-password "$1$h1exJ00p$a8TT/s.VKWtxI8cWBVwtS1"; ## SECRET-DATA
    }
    services {
        telnet;
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
logical-routers {
    r1 {
        interfaces {
            fxp1 {
                unit 11 {
                    vlan-id 11;
                    family inet {
                        address 192.168.1.1/24;
                    }
                }
            }
            lo0 {
                unit 1 {
                    family inet {
                        address 1.1.1.1/32;
                    }
                }
            }
        }
        protocols {
            bgp {
                multihop;
                export ospf;
                group internal {
                    type internal;
                    local-address 1.1.1.1;
                    neighbor 2.2.2.2;
                }
            }
            ospf {
                export ospf;
                area 0.0.0.0 {
                    interface all;
                }
            }
        }
        policy-options {
            policy-statement ospf {
                term 1 {
                    from interface [ fxp1.11 lo0.1 ];
                    then accept;
                }
            }
        }
        routing-options {
            router-id 1.1.1.1;
            autonomous-system 65500;
        }
    }
    r2 {
        interfaces {
            fxp2 {
                unit 11 {
                    vlan-id 11;
                    family inet {
                        address 192.168.1.2/24;
                    }
                }
            }
            lo0 {
                unit 2 {
                    family inet {
                        address 2.2.2.2/32;
                    }
                }
            }
        }
        protocols {
            bgp {
                multihop;
                export ospf;
                group internal {
                    type internal;
                    local-address 2.2.2.2;
                    neighbor 1.1.1.1;
                }
            }
            ospf {
                export ospf;
                area 0.0.0.0 {
                    interface all;
                }
            }
        }
        policy-options {
            policy-statement ospf {
                term 1 {
                    from {
                        protocol static;
                        interface [ fxp2.11 lo0.2 ];
                    }
                    then accept;
                }
            }
        }
        routing-options {
            router-id 2.2.2.2;
            autonomous-system 65500;
        }
    }
    r3;
}
interfaces {
    fxp0 {
        vlan-tagging;
    }
    fxp1 {
        vlan-tagging;
    }
    fxp2 {
        vlan-tagging;
    }
}

root>
原的版本是不是tcp连接延时太大了呀?
myiso,u are great! 高手就是不一样
我没有做什么,在qemu本身上加了mmm123的代码而已。呵呵。算是搞了个集成。
7.4的版本,ospf邻居起不来。
呵呵,不可能的
我的就是7.4。

root> show version
Model: olive
JUNOS Base OS boot [7.4R1.7]
JUNOS Base OS Software Suite [7.4R1.7]
JUNOS Kernel Software Suite [7.4R1.7]
JUNOS Packet Forwarding Engine Support (M20/M40) [7.4R1.7]
JUNOS Routing Software Suite [7.4R1.7]
JUNOS Online Documentation [7.4R1.7]


root> show ospf neighbor   
OSPF instance is not running

root> show ospf neighbor logical-router p2
  Address         Interface             State      ID              Pri  Dead
192.255.198.1    fxp1.34                Full      10.255.255.179   128    35
192.255.198.9    fxp2.23                Full      10.255.255.177   128    32
wanzxj
你帮我看看这个里面的BGP有什么问题没有?上个星期弄出了一个QEMU版本.
http://www.netemu.cn/bbs/thread-5153-1-1.html

[ 本帖最后由 锅巴粥 于 2007-9-17 14:13 编辑 ]
呵呵,没有问题呀,你的BGP 邻居已经建立起来了。

root# run show bgp neighbor logical-router all

logical-router: r1
Peer: 10.0.31.1+179 AS 65505   Local: 10.0.31.2+4240 AS 65500
  Type: External    State: Established    Flags:

看来你编译的版本和myios都一样。都可以正常使用。
呵呵
我看大家以后把QEMU模拟olive的帖子发到QEMU区吧
猫哥发怒了要

今天上午刚刚拿真机装上了olive

[ 本帖最后由 锅巴粥 于 2007-9-17 14:22 编辑 ]
晕,我说咋变地方了。呵呵。
到哪都一样。有什么问题请及时反馈。也算是帮juniper公司推广他们的junos软件。
myios
想问个题外话
你是修改了eepro100.c 里的nic_receive函数里的内容么?
恩,是的,把组播加上了。还修改了几个其他的地方有没有作用不清楚了。不过凑合着能用了。
我上此也改过一次  nic_receive
呵呵。不过我自己测试的有问题 (BGP可以了,可OSPF却不行,怪问题)
主要是看了qemu-devel里的回复受到的启发
http://www.mail-archive.com/qemu-devel@nongnu.org/msg11293.html
我比对了一下你修改的eepro100.c跟官方的eepro100.c
其中不同的地方:
官方:
  1. else if (buf[0] & 0) { // !!!
  2.         /* Multicast frame. */
  3.         logout("%p received multicast, len=%d\n", s, size);
  4.         /* TODO: check multicast all bit. */
  5.         assert(!(s->configuration[21] & BIT(3)));
  6.         int mcast_idx = compute_mcast_idx(buf);
  7.         if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) {
  8.             return;
  9.         }
  10.         rfd_status |= 0x0002;
复制代码
你修改的部分:
  1. else if (buf[0] & 0) { // !!!
  2.         /* Multicast frame. */
  3.         logout("%p received multicast, len=%d\n", s, size);
  4.         /* TODO: check multicast all bit. */
  5.         assert(!(s->configuration[21] & BIT(3)));
  6.         if (s->multicast_addr_count !=0 ) {int i;
  7.         for (i=0;(imulticast_addr_count) && (MA_match==0);i++)
  8.                      {
  9.           MA_match=memcmp(buf,&s->multicast_address[0],6);
  10.                       }
  11.         //int mcast_idx = compute_mcast_idx(buf);
  12.         //if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) {
  13.             //return;
  14.         //}
  15.         }
  16.         rfd_status |= 0x0002;
复制代码
注释调了
  1. int mcast_idx = compute_mcast_idx(buf);
  2.         if (!(s->mult[mcast_idx >> 3] & (1 << (mcast_idx & 7)))) {
  3.             return;
复制代码
如果你有时间的话,能否对你修改的部分解释一下.
我没看懂

[ 本帖最后由 锅巴粥 于 2007-9-17 16:28 编辑 ]
恩,屏蔽掉的那几行,我不是很清楚是做什么用的,不过加上组播就不成功。
  1.   if (s->multicast_addr_count !=0 ) {int i;
  2.         for (i=0;(imulticast_addr_count) && (MA_match==0);i++)
  3.                      {
  4.           MA_match=memcmp(buf,&s->multicast_address[0],6);
  5.                       }
复制代码
这一段呢?
你看看上面还有一处改动,在大概704行开始,是加入组播地址。这是组播成功的关键。
呵呵,新版本测试没有问题。OSPF、BGP、MPLS VPN都正常。后面打算测试一下RSVP方式的MPLS VPN看有没有问题。谢谢myios!!!
好的,期待你的试验。
返回列表