当前位置: 技术问答>linux和unix
重启后不能自动上网的问题
来源: 互联网 发布时间:2016-01-20
本文导语: 安装好AS4 U4 linux后,系统不能自动上网也不能ping通。 机器上有两块网卡,eth0上接有网线。 需要运行一下。 ifdown eth0 ifup eth0网络才会通。 运行ifconfig -a显示如下: eth0 Link encap:Ethernet HWaddr 00:18:8B:7B:6...
安装好AS4 U4 linux后,系统不能自动上网也不能ping通。
机器上有两块网卡,eth0上接有网线。
需要运行一下。
ifdown eth0
ifup eth0网络才会通。
运行ifconfig -a显示如下:
eth0 Link encap:Ethernet HWaddr 00:18:8B:7B:6E:72
inet addr:198.168.8.60 Bcast:198.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe7b:6e72/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:169 Memory:f4000000-f4011100
eth1 Link encap:Ethernet HWaddr 00:18:8B:7B:6E:70
inet addr:198.168.8.61 Bcast:198.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe7b:6e70/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1655041 errors:0 dropped:0 overruns:0 frame:0
TX packets:819793 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1748755561 (1.6 GiB) TX bytes:53291375 (50.8 MiB)
Interrupt:169 Memory:f8000000-f8011100
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:2280 errors:0 dropped:0 overruns:0 frame:0
TX packets:2280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3049220 (2.9 MiB) TX bytes:3049220 (2.9 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 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)
vi etc/sysconfig/network_scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=198.168.8.60
NETMASK=255.255.255.0
GATEWAY=198.168.8.199
vi etc/sysconfig/network_scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
BROADCAST=198.168.8.255
HWADDR=00:18:8b:7b:6e:70
IPADDR=198.168.8.61
NETMASK=255.255.255.0
NETWORK=198.168.8.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=198.168.8.199
机器上有两块网卡,eth0上接有网线。
需要运行一下。
ifdown eth0
ifup eth0网络才会通。
运行ifconfig -a显示如下:
eth0 Link encap:Ethernet HWaddr 00:18:8B:7B:6E:72
inet addr:198.168.8.60 Bcast:198.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe7b:6e72/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 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:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:169 Memory:f4000000-f4011100
eth1 Link encap:Ethernet HWaddr 00:18:8B:7B:6E:70
inet addr:198.168.8.61 Bcast:198.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::218:8bff:fe7b:6e70/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1655041 errors:0 dropped:0 overruns:0 frame:0
TX packets:819793 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1748755561 (1.6 GiB) TX bytes:53291375 (50.8 MiB)
Interrupt:169 Memory:f8000000-f8011100
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:2280 errors:0 dropped:0 overruns:0 frame:0
TX packets:2280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3049220 (2.9 MiB) TX bytes:3049220 (2.9 MiB)
sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 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)
vi etc/sysconfig/network_scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=198.168.8.60
NETMASK=255.255.255.0
GATEWAY=198.168.8.199
vi etc/sysconfig/network_scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
BROADCAST=198.168.8.255
HWADDR=00:18:8b:7b:6e:70
IPADDR=198.168.8.61
NETMASK=255.255.255.0
NETWORK=198.168.8.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=198.168.8.199
|
这么奇怪?没看出哪儿有问题啊~
|
网络不通时,ifconfig -a怎样?