eth0是内网,今天又加了块网卡,eth2,但怎么都弄不好·····
此机器兼做路由,dhcp服务器,dns缓存,BT+文件共享,iscsi······
代码: 全选
skyblue@MAGI:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:e0:81:55:49:29
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:81ff:fe55:4929/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6096703 errors:0 dropped:0 overruns:0 frame:0
TX packets:7720502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:723319107 (723.3 MB) TX bytes:134505311 (134.5 MB)
eth1 Link encap:Ethernet HWaddr 00:e0:81:55:49:28
inet6 addr: fe80::2e0:81ff:fe55:4928/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13714826 errors:0 dropped:0 overruns:0 frame:0
TX packets:19616610 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3623477356 (3.6 GB) TX bytes:3315395982 (3.3 GB)
Interrupt:5 Base address:0xe100
eth2 Link encap:Ethernet HWaddr 00:21:27:a2:ac:21
inet6 addr: fe80::221:27ff:fea2:ac21/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:552 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:58745 (58.7 KB) TX bytes:468 (468.0 B)
Interrupt:11 Base address:0xe000
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:442908 errors:0 dropped:0 overruns:0 frame:0
TX packets:442908 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:47756614 (47.7 MB) TX bytes:47756614 (47.7 MB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:58.242.82.26 P-t-P:58.242.82.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:70716 errors:0 dropped:0 overruns:0 frame:0
TX packets:100159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:11004978 (11.0 MB) TX bytes:109279827 (109.2 MB)
skyblue@MAGI:~$
代码: 全选
skyblue@MAGI:~$ sudo /etc/init.d/networking restart
* Reconfiguring network interfaces... S
IOCDELRT: No such process
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.8p compiled against pppd 2.4.5
ssh stop/waiting
ssh start/running, process 15849
ssh stop/waiting
ssh start/running, process 15904
ssh stop/waiting
ssh start/running, process 15954
Failed to bring up eth2.
代码: 全选
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth1 up # line maintained by pppoeconf
provider dsl-provider
auto eth0
iface eth0 inet static
#iface eth0 inet manual
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1
auto eth1
iface eth1 inet manual
#address 192.168.1.1
#netmask 255.255.255.0
#gateway 192.168.1.1
auto eth2
iface eth2 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.1
#pre-up iptbles-restore < /etc/iptables.up.rules
#post-down iptables-save > /etc/iptables.up.rules
代码: 全选
#
# Sample configuration file for ISC dhcpd for Debian
············
# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;
# option definitions common to all supported networks...
#option domain-name "tattat.8800.org";
option domain-name-servers 192.168.1.1, 8.8.8.8;
#option domain-name-servers 8.8.8.8, 8.8.4.4;
#option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
default-lease-time 86400;
max-lease-time 86400;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
............
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.200;
option subnet-mask 255.255.255.0;
option routers 192.168.1.1;
option broadcast-address 192.168.1.255;
}
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.10 192.168.2.200;
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
option broadcast-address 192.168.2.255;
option domain-name-servers 192.168.2.1, 8.8.8.8;
}
host pc {
hardware ethernet 00:1b:fc:74:51:1c;
fixed-address 192.168.1.100;
}