ps: 正考虑是否该去做个变性手术,好多赚点今天的加班费。:shock:
//无网关
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
# ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:132 errors:0 dropped:0 overruns:0 frame:0
TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13196 (12.8 KiB)TX bytes:7710 (7.5 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:200 (200.0 b)TX bytes:200 (200.0 b)
# adsl-start
Deleting all exist defaultroute ....
. Connected!
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
# ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:267 errors:0 dropped:0 overruns:0 frame:0
TX packets:116 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:23809 (23.2 KiB)TX bytes:11107 (10.8 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:200 (200.0 b)TX bytes:200 (200.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:123.74.81.5P-t-P:24.24.24.24Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICASTMTU:1492Metric:1
RX packets:29 errors:0 dropped:0 overruns:0 frame:0
TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1602 (1.5 KiB)TX bytes:2041 (1.9 KiB)
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms
# adsl-stop
Done.
//添上网关modem 192.168.1.1
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
# ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:501 errors:0 dropped:0 overruns:0 frame:0
TX packets:147 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42521 (41.5 KiB)TX bytes:13466 (13.1 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:284 (284.0 b)TX bytes:284 (284.0 b)
# adsl-start
Deleting all exist defaultroute ....
. Connected!
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
# ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:651 errors:0 dropped:0 overruns:0 frame:0
TX packets:164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57944 (56.5 KiB)TX bytes:14157 (13.8 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:284 (284.0 b)TX bytes:284 (284.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:123.74.86.67P-t-P:24.24.24.24Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICASTMTU:1492Metric:1
RX packets:21 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:2332 (2.2 KiB)TX bytes:61 (61.0 b)
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1011ms
无论有无网关,adsl-start都可以连上,但是ping 127.0.0.1都不通. default * 0.0.0.0 U 0 0 0 ppp0
这个明显不对.
route del gw default
route add gw default 123.74.86.67(这个改成你ppp0的地址). # route del gw default
gw: 主机名搜索失败 //运行命令不成功
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
# route del default //这样倒是删掉了默认网关
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
# route add gw default 123.74.81.175 //我的ppp0地址
gw: 主机名搜索失败 //运行命令不成功
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1010ms 我写反了,应该是default gw。 # ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:1278 errors:0 dropped:0 overruns:0 frame:0
TX packets:574 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:113304 (110.6 KiB)TX bytes:43785 (42.7 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:200 (200.0 b)TX bytes:200 (200.0 b)
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.151 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.088 ms
^C
--- 127.0.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.088/0.119/0.151/0.033 ms
# adsl-start
Deleting all exist defaultroute ....
. Connected!
# ifconfig
eth0 Link encap:EthernetHWaddr 00:03:9D:71:67:57
inet addr:192.168.1.11Bcast:192.168.1.255Mask:255.255.255.0
inet6 addr: fe80::203:9dff:fe71:6757/64 Scope:Link
UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
RX packets:1388 errors:0 dropped:0 overruns:0 frame:0
TX packets:602 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:121871 (119.0 KiB)TX bytes:45272 (44.2 KiB)
Interrupt:6 Base address:0x9c00
lo Link encap:Local Loopback
inet addr:127.0.0.1Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNINGMTU:16436Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:536 (536.0 b)TX bytes:536 (536.0 b)
ppp0 Link encap:Point-to-Point Protocol
inet addr:123.74.84.69P-t-P:24.24.24.24Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICASTMTU:1492Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:54 (54.0 b)TX bytes:61 (61.0 b)
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5010ms
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default * 0.0.0.0 U 0 0 0 ppp0
# route del default
# route add default gw 123.74.84.69
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
24.24.24.24 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 123.74.84.69 0.0.0.0 UG 0 0 0 ppp0
# ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
^C
--- 127.0.0.1 ping statistics ---
12 packets transmitted, 0 received, 100% packet loss, time 10999ms
# ping 123.74.84.69
PING 123.74.84.69 (123.74.84.69) 56(84) bytes of data.
^C
--- 123.74.84.69 ping statistics ---
11 packets transmitted, 0 received, 100% packet loss, time 10010ms
#
外甥打灯笼——照旧啊:shock: 奇怪了。我看了下我这里。
网关和地址还真不一样,这个就难办了。
页:
1
[2]