- 论坛徽章:
- 0
|
[root@Runtop ~]# 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
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@Runtop ~]# route add -net 10.0.0.0 netmask 255.255.255.0 dev eth1
[root@Runtop ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@Runtop ~]# 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
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
[root@Runtop ~]#
怎么加不进10.0.0.0/24网络?两张网卡(eth0 连外网 ,eth1连内网,PING不通10.0.0.0里的机子)
[root@Runtop ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:BF:5D:6E:15
inet addr:192.168.1.89 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::214:bfff:fe5d:6e15/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3274 errors:0 dropped:0 overruns:0 frame:0
TX packets:2062 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:256281 (250.2 KiB) TX bytes:243975 (238.2 KiB)
Interrupt:10 Base address:0x6000
eth1 Link encap:Ethernet HWaddr 00:18:F8:08:BA:57
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::218:f8ff:fe08:ba57/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:337 errors:0 dropped:0 overruns:0 frame:0
TX packets:87 errors:9 dropped:0 overruns:0 carrier:18
collisions:0 txqueuelen:1000
RX bytes:57783 (56.4 KiB) TX bytes:13070 (12.7 KiB)
Interrupt:11 Base address:0xa000
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:1852 errors:0 dropped:0 overruns:0 frame:0
TX packets:1852 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2786710 (2.6 MiB) TX bytes:2786710 (2.6 MiB)
[root@Runtop ~]#
[root@Runtop ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Linksys NC100 Network Everywhere Fast Ethernet 10/100
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:14:BF:5D:6E:15
IPADDR=192.168.1.89
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BOARDCAST=192.168.1.255
GATEWAY=192.168.1.1
[root@Runtop ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# Linksys NC100 Network Everywhere Fast Ethernet 10/100
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:18:F8:08:BA:57
IPADDR=10.0.0.1
NETMASK=255.255.255.0
BROADCAST=10.0.0.255
[root@Runtop ~]# |
|