- 论坛徽章:
- 0
|
上网方式是拨号,adsl pppoe.
如果 /etc/network/interfaces 的配置文件是
auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
网络连接后
ifconfig
eth0 Link encap:Ethernet HWaddr e0:3f:49:57:4b:d1
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::e23f:49ff:fe57:4bd1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:821 errors:0 dropped:218 overruns:0 frame:0
TX packets:725 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:167817 (163.8 KiB) TX bytes:122295 (119.4 KiB)
本机的eth0被指定了ip地址 192.168.1.101
现在使用dhcp方式设置
/etc/network/interfaces 改成下面的方式
auto eth0
iface eth0 inet dhcp
ifconfig
eth0 Link encap:Ethernet HWaddr e0:3f:49:57:4b:d1
inet6 addr: fd8d:7a2d:f1e2:0:e23f:49ff:fe57:4bd1/64 Scope:Global
inet6 addr: fe80::e23f:49ff:fe57:4bd1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9939 errors:0 dropped:0 overruns:0 frame:0
TX packets:9617 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8321348 (7.9 MiB) TX bytes:1331252 (1.2 MiB)
我可否做到,在dhcp设置状态下,让eth0也具备一个同样的ip地址 192.168.1.101 ? |
|