|
|
发表于 2009-9-2 12:02:37
|
显示全部楼层
我改成- eth0="dhcp"
- eth00="eth0:0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
- INTERFACES=(eth0 eth00)
- #gateway="default gw 192.168.0.1"
- ROUTES=(!gateway)
复制代码 重启后:- # ifconfig
- eth0 Link encap:Ethernet HWaddr 00:16:D3:FC:89:1D
- inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::216:d3ff:fefc:891d/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:710 errors:0 dropped:0 overruns:0 frame:0
- TX packets:824 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:583934 (570.2 Kb) TX bytes:143123 (139.7 Kb)
- Interrupt:27 Base address:0x8000
- eth0:0 Link encap:Ethernet HWaddr 00:16:D3:FC:89:1D
- inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- Interrupt:27 Base address:0x8000
- 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:72 errors:0 dropped:0 overruns:0 frame:0
- TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:3720 (3.6 Kb) TX bytes:3720 (3.6 Kb)
复制代码 dhcp 这段能用,现在还上网,不知道另一个网段是否能用,一台机器好像没法测试。我最多只能- # ping 192.168.0.2
- PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data.
- 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.087 ms
- 64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.067 ms
- 64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.070 ms
- 64 bytes from 192.168.0.2: icmp_seq=4 ttl=64 time=0.068 ms
- 64 bytes from 192.168.0.2: icmp_seq=5 ttl=64 time=0.071 ms
- 64 bytes from 192.168.0.2: icmp_seq=6 ttl=64 time=0.069 ms
- ^C
- --- 192.168.0.2 ping statistics ---
- 6 packets transmitted, 6 received, 0% packet loss, time 4997ms
- rtt min/avg/max/mdev = 0.067/0.072/0.087/0.006 ms
复制代码 |
|