- 论坛徽章:
- 0
|
本帖最后由 haide1014 于 2010-08-28 13:56 编辑
- linux的路由配置
- -------------------------------------------------------------------------------
- [root@CentOS ~]# netstat -nr
- Kernel IP routing table
- Destination Gateway Genmask Flags MSS Window irtt Iface
- 192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
- 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
- 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
- 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
- 192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
- 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 eth0
- --------------------------------------------------------------------------------
- linux的网卡配置信息
- [root@CentOS ~]# ifconfig
- eth0 Link encap:Ethernet HWaddr 00:40:CA:79:72:7A
- inet addr:192.168.2.10 Bcast:172.168.255.255 Mask:255.255.0.0
- inet6 addr: fe80::240:caff:fe79:727a/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:26200 errors:0 dropped:0 overruns:0 frame:0
- TX packets:267 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:1902836 (1.8 MiB) TX bytes:25089 (24.5 KiB)
- Interrupt:193 Base address:0xa000
- eth1 Link encap:Ethernet HWaddr 00:1D:0F:13:5D:1A
- inet addr:192.168.7.7 Bcast:192.168.255.255 Mask:255.255.0.0
- inet6 addr: fe80::21d:fff:fe13:5d1a/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:435 errors:0 dropped:0 overruns:0 frame:0
- TX packets:141 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:38168 (37.2 KiB) TX bytes:19712 (19.2 KiB)
- Interrupt:169 Base address:0x8000
- --------------------------------------------------------------------------------
- linux服务器的sysctl.conf配置文件
- [root@CentOS ~]# cat /etc/sysctl.conf
- # Kernel sysctl configuration file for Red Hat Linux
- #
- # For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
- # sysctl.conf(5) for more details.
- # Controls IP packet forwarding
- net.ipv4.ip_forward = 1
- # Controls source route verification
- net.ipv4.conf.default.rp_filter = 1
- # Do not accept source routing
- net.ipv4.conf.default.accept_source_route = 0
- # Controls the System Request debugging functionality of the kernel
- kernel.sysrq = 0
- # Controls whether core dumps will append the PID to the core filename
- # Useful for debugging multi-threaded applications
- kernel.core_uses_pid = 1
- # Controls the use of TCP syncookies
- net.ipv4.tcp_syncookies = 1
- # Controls the maximum size of a message, in bytes
- kernel.msgmnb = 65536
- # Controls the default maxmimum size of a mesage queue
- kernel.msgmax = 65536
- # Controls the maximum shared segment size, in bytes
- kernel.shmmax = 4294967295
- # Controls the maximum number of shared memory segments, in pages
- kernel.shmall = 268435456
- --------------------------------------------------------------------------------
- 网段B的路由表
- SZ#show ip route
- Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
- D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
- N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
- E1 - OSPF external type 1, E2 - OSPF external type 2
- i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
- ia - IS-IS inter area, * - candidate default, U - per-user static route
- o - ODR, P - periodic downloaded static route
- Gateway of last resort is 192.168.4.1 to network 0.0.0.0
- 192.168.0.0/24 is subnetted, 2 subnets
- S 192.168.7.0 [1/0] via 192.168.2.10
- C 192.168.2.0 is directly connected, FastEthernet0/1
- 172.19.0.0/24 is subnetted, 1 subnets
- C 192.168.4.1 is directly connected, FastEthernet0/0
- 172.18.0.0/24 is subnetted, 1 subnets
- C 192.168.3.1 is directly connected, Serial0/1/0
- S* 0.0.0.0/0 [1/0] via 192.168.4.1
- [1/0] via 192.168.3.1
- 网段B的arp表
- SZ#show arp
- Protocol Address Age (min) Hardware Addr Type Interface
- Internet 192.168.2.0 61 6cf0.498b.0726 ARPA FastEthernet0/1
- Internet 192.168.2.1 0 0023.cd8d.d949 ARPA FastEthernet0/1
- Internet 192.168.2.2 - 0026.9972.ec7b ARPA FastEthernet0/1
- Internet 192.168.2.3 128 001d.0fa3.e051 ARPA FastEthernet0/1
- Internet 192.168.2.4 0 000e.7ffe.9a70 ARPA FastEthernet0/1
- ............................................................................
- Internet 192.168.4.1 155 0025.454d.15b6 ARPA FastEthernet0/0
- Internet 192.168.3.1 - 0026.9972.ec7a ARPA FastEthernet0/0
复制代码 |
|