Linux环境:Ubuntu
内网IP为:10.10.20.10 子网掩码为:255.255.255.224 网关为:10.10.20.1 有线网卡
外网IP为:192.168.124.28 子网掩码为:255.255.255.0 网关为: 192.168.124.1 无线网卡
1.当配置服务器为外网IP和内网IP的方式时,只设置外网IP的网关,不要设置内网IP的网关.
无线配置生成
内网IP为:10.10.20.10 子网掩码为:255.255.255.224 网关为:10.10.20.1 有线网卡
外网IP为:192.168.124.28 子网掩码为:255.255.255.0 网关为: 192.168.124.1 无线网卡
1.当配置服务器为外网IP和内网IP的方式时,只设置外网IP的网关,不要设置内网IP的网关.
配置如下
auto lo
iface lo inet loopback
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 10.10.20.10
netmask 255.255.255.224
# gateway 10.10.20.1
#auto wlan0
#iface wlan0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.124.28
netmask 255.255.255.0
gateway 192.168.124.1
wpa-conf /etc/wifi.conf
无线配置生成
$ pa_passphrase H3C_Developer "progz_w00t!" >>/etc/wifi.conf
# 重启网卡
$ sudo /etc/init.d/networking restart
# 手动设置服务器的路由
route add -net 10.10.20.0/24 gw 10.10.20.1 dev eth0