求助:这些命令怎么批处理运行?(已解决)
发表于 : 2008-10-27 14:50
最近在配virtualbox客户xp和ubuntu的网桥,主要按下面两个地方说的改改来用。
http://blog.chinaunix.net/u1/35100/showart_288321.html
http://mmlst.com/2008/07/06/ubuntu%E4%B ... %EF%BC%89/
已成功。具体命令如下:
sudo tunctl -t tap0 -u adl003
sudo brctl addbr br0
sudo ifconfig eth0 0.0.0.0 promisc
sudo brctl addif br0 eth0
sudo ifconfig br0 192.168.1.101 netmask 255.255.255.0 up
sudo route add default gw 192.168.1.1
sudo ifconfig tap0 0.0.0.0 promisc
sudo brctl addif br0 tap0
sudo ifconfig tap0 up
sudo chmod 0666 /dev/net/tun
在终端中逐条运行,能正确配置,实现虚拟机中的XP和主机ubuntu同时上网。
但按照上面第二个链接的介绍做开机自启动不成功,试过手动SUDO执行自启动文件(内容如上,只是不要每句前面的SUDO)也发生错误,提示如下:
adl003@adl003-laptop:~$ sudo /home/adl003/netstart
' is neither a username nor a numeric uid.
Create: tunctl [-b] [-u owner] [-g group] [-t device-name] [-f tun-clone-device]
Delete: tunctl -d device-name [-f tun-clone-device]
The default tun clone device is /dev/net/tun - some systems use
/dev/misc/net/tun instead
-b will result in brief output (just the device name)
: not found3/netstart: 2:
add bridge failed: Invalid argument
: not found3/netstart: 4:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 6:
does not exist!
: not found3/netstart: 8:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 10:
SIOCADDRT: 文件已经存在
: not found3/netstart: 12:
does not exist!
: not found3/netstart: 16:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 18:
每次启动后一行行打命令多累啊!哪位高人出来帮个忙吧,这个自启动怎么实现啊??
http://blog.chinaunix.net/u1/35100/showart_288321.html
http://mmlst.com/2008/07/06/ubuntu%E4%B ... %EF%BC%89/
已成功。具体命令如下:
sudo tunctl -t tap0 -u adl003
sudo brctl addbr br0
sudo ifconfig eth0 0.0.0.0 promisc
sudo brctl addif br0 eth0
sudo ifconfig br0 192.168.1.101 netmask 255.255.255.0 up
sudo route add default gw 192.168.1.1
sudo ifconfig tap0 0.0.0.0 promisc
sudo brctl addif br0 tap0
sudo ifconfig tap0 up
sudo chmod 0666 /dev/net/tun
在终端中逐条运行,能正确配置,实现虚拟机中的XP和主机ubuntu同时上网。
但按照上面第二个链接的介绍做开机自启动不成功,试过手动SUDO执行自启动文件(内容如上,只是不要每句前面的SUDO)也发生错误,提示如下:
adl003@adl003-laptop:~$ sudo /home/adl003/netstart
' is neither a username nor a numeric uid.
Create: tunctl [-b] [-u owner] [-g group] [-t device-name] [-f tun-clone-device]
Delete: tunctl -d device-name [-f tun-clone-device]
The default tun clone device is /dev/net/tun - some systems use
/dev/misc/net/tun instead
-b will result in brief output (just the device name)
: not found3/netstart: 2:
add bridge failed: Invalid argument
: not found3/netstart: 4:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 6:
does not exist!
: not found3/netstart: 8:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 10:
SIOCADDRT: 文件已经存在
: not found3/netstart: 12:
does not exist!
: not found3/netstart: 16:
: 未知的主机
ifconfig: `--help' 给出使用信息。
: not found3/netstart: 18:
每次启动后一行行打命令多累啊!哪位高人出来帮个忙吧,这个自启动怎么实现啊??