Ubuntu 12.04 Android 编译搭建全程--(一)ubuntu安装

 =====================================================================

配置:

lenovo

product: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
64 bits
4G内存

======================================================================

原先是WIN8系统,使用 Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic x86_64)镜像安装。

安装完系统后开机后ubnutu无法联网,在终端中#:ifconfig后,

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet6 addr: fe80::d63d:7eff:fec8:bf7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3406 errors:0 dropped:0 overruns:0 frame:0
          TX packets:378 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:478898 (478.8 KB)  TX bytes:61014 (61.0 KB)
          Interrupt:43 Base address:0xa000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

说明一下公司网络环境

统一自动分配IP。为什么重装系统后会无法正常联网呢。

Q1: 网卡驱动安装不正常?

A1:可以排除
通过lshw查看硬件信息

joe@ubuntu:~$ lshw -c net
WARNING: you should run this program as super-user.
  *-network               
       description: Ethernet interface
       product: RTL8111/8168B PCI Express Gigabit Ethernet controller

而且ifconfig也是有eth0的,所以不可能是这个问题。

Q2:网络通路查看

A2:

ping 127.0.0.1

ping 127.0.0.1 正常

ping同网段的主机

ping 172.16.148.1

提示:connect: network is unreachable

网络不通

 

最后找到的解决方法


Com a rede já pronta, agora vamos efetuar o compartilhamento da Internet.

Agora vamos habilitar o encaminhamento de IPv4.

原来公司这边使用的IP自动分配为IPV4的IP,而Ubuntu 12.04 server 默认的话是IPV6

所以只要修改ipv6为IPV4
 
$ sudo vim /etc/sysctl.conf
修改
# net.ipv4.ip_forward=1 
为  
 net.ipv4.ip_forward=1

当然因为公司的网络管理是自动获取IP不允许绑定IP,一个端口自动获取完就与mac绑定了。如果是使用固定的静态IP配置应该不出现这个问题。
 
 
eth0      Link encap:Ethernet  HWaddr xxxxxxxxx
          inet addr:172.16.148.107  Bcast:172.16.148.255  Mask:255.255.255.0
          inet6 addr: fe80::d63d:7eff:fec8:bf7b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5194 errors:0 dropped:0 overruns:0 frame:0
          TX packets:449 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:730904 (730.9 KB)  TX bytes:70328 (70.3 KB)
          Interrupt:43 Base address:0xa000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值