天天看點

qemu PPP連接配接

呵呵,出差最大的好處就是不用安排時間陪老婆大人:)

用qemu虛拟兩台序列槽連接配接裝置,利用udp模拟序列槽。再在序列槽上配置pppd。這樣就模拟簡單路由器就有戲了:)

  host--eth-rt1---serial---rt2---eth--host

rt1 qemu配置:

qemu-system-x86_64 -m pc -m 64 -hda ./rtimg.1 \

    -k en-us \

    -net nic,vlan=0 -net tap,ifname=tap0,vlan=0 \

    -serial udp:127.0.0.1:[email protected]:7002 \

    -boot c &

rt2 qemu配置:

qemu-system-x86_64 -m pc -m 64 -hda ./rtimg.2 \

    -net nic,vlan=0 -net tap,ifname=tap1,vlan=0 \

    -serial udp:127.0.0.1:[email protected]:7001 \

host系統上tap接口配置如下:

z00895@z00895u:~/app/nds/rt1-rt2$ cat /etc/network/interfaces

~~~~~

auto tap0

iface tap0 inet manual

up ifconfig $iface 0.0.0.0 up

down ifconfig $iface down

tunctl_user xxx

auto tap1

iface tap1 inet manual

rtimg.1 與rtimg.2均安裝gentoo系統,其中ppp配置為:

pppd  10.0.1.1:10.0.1.2 /dev/ttys0 38400 &

pppd  10.0.1.2:10.0.1.1 /dev/ttys0 38400 &

unix/linux淵遠流長,pppd相關文檔集中于撥号領域,要簡明還真的很難。如上指令顯然不是很嚴謹,不過示範而已。

下一步,當然是quagga on gentoo了:)

繼續閱讀