use method2 ok
method 1:
Edit /etc/network/interfaces
add
auto usb0
iface usb0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
up iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24 &
up echo 1 > /proc/sys/net/ipv4/ip_forward &
up iptables -P FORWARD ACCEPT &
down iptables -D POSTROUTING -t nat -j MASQUERADE -s 192.168.1.0/24 &
method2:
#添加到电脑里的文件/etc/network/interfaces
allow-hotplug usb0
iface usb0 inet static
添加到/etc/network/interfaces里,加进去之后运行 /etc/init.d/network-manager restart