第1页共52页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第1页共52页在DNS服务器上,配置路由工作总结2009-11-03于知音网通电信双线服务器路由配置一.服务器状态网通使用第一块网卡(eth0):DEVICE=eth0BOOTPROTO=noneHWADDR=00:24:e8:5c:91:6fIPADDR=220.249.73.236NETMASK=255.255.255.224GATEWAY=220.249.73.225ONBOOT=yesTYPE=Ethernet电信使用第二块网卡(eth1):DEVICE=eth1HWADDR=00:24:e8:5c:91:71IPADDR=219.140.171.156NETMASK=255.255.255.224GATEWAY=219.140.171.145ONBOOT=yesDHCP_HOSTNAME=F35TYPE=EthernetBOOTPROTO=nonevi/etc/sysconfig/networking/profiles/default/route-eth0GATEWAY0=220.249.73.225NETMASK0=255.255.255.224ADDRESS0=220.249.73.236vi/etc/sysconfig/networking/profiles/default/resolv.confnameserver202.103.24.68//电信DNSnameserver218.104.111.122//网通DNS二.配置路由表#vi/etc/iproute2/rt_tables,增加网通和电信两个路由表252cnc251tel第2页共52页第1页共52页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第2页共52页设置网通的路由表#iprouteadd220.249.73.0/24via220.249.73.236deveth0tablecnc#iprouteadd127.0.0.0/8devlotablecnc#iprouteadddefaultvia220.249.73.225deveth0tablecnc设置电信的路由表iprouteadd219.140.171.0/24via219.140.171.156deveth1tableteliprouteadd127.0.0.0/8devlotableteliprouteadddefaultvia219.140.171.145deveth1tabletel三.制定策略让219.140.171.156的回应数据包走电信的路由表路由,220.249.73.236的回应数据包走网通的路由表路由。ipruleaddfrom219.140.171.156tabletelipruleaddfrom220.249.73.236tablecnc四.修改IP转发文件#vi/etc/sysctl.confnet.ipv4.ip_forward=1net.ipv4.conf.default.rp_filter=1kernel.sysrq=0使设置生效:sysctl-p五.设置静态路由表文件#vi/etc/sysconfig/static-routeseth0net220.249.73.236netmask255.255.255.224gw220.249.73.225eth1net219.140.171.156netmask255.255.255.224gw219.140.171.145将从两个WAN口出去的数据包进行IP伪装masquerade#/sbin/modprobeip_conntrack_ftp第3页共52页第2页共52页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第3页共52页#/sbin/modprobeip_nat_ftp#/sbin/iptables-tnat-Apostrouting-oeth0-jmasquerade//防火墙#/sbin/iptables-tnat-Apostrouting-oeth1-jmasquerade//防火墙设置默认网关为电信#routeadddefaultgw219.140.171.145增加出口路由策略,客户端是网通的走网通线路,其余走电信线路。#!/bin/shipruleaddto58.17.150.0/24tablecncipruleaddto58.17.161.0/24tablecncipruleaddto58.17.180.0/24tablecncipruleaddto58.17.186.0/24tablecncipruleaddto58.18.0.0/16tablecncipruleaddto58.20.0.0/16tablecncipruleaddto58.21.0.0/16tablecncipruleaddto58.22.0.0/16tablecncipruleaddto58.23.0.0/16tablecncipruleaddto58.244.0.0/16tablecncipruleaddto58.245.0.0/16tablecncipruleaddto58.246.0.0/16tablecncipruleaddto58.250.0.0/16tablecncipruleaddto58.251.0.0/16tablecncipruleaddto58.252.0.0/16tablecncipruleaddto58.253.0.0/16tablecncipruleaddto58.254.0.0/16tablecncipruleaddto58.255.0.0/16tablecncipruleaddto60.0.0.0/16tablecncipruleaddto60.10.0.0/16tablecncipruleaddto60.1.0.0/16tablecncipruleaddto60.13.124.0/24tablecncipruleaddto60.16.0.0/16tablecncipruleaddto60.17.0.0/16tablecncipruleaddto60.18.0.0/16tablecncipruleaddto60.19.0.0/16tablecncipruleaddto60.20.0.0/16tablecncipruleaddto60.2.0.0/16tablecncipruleaddto60.21.0.0/16tablecncipruleaddto60.22.0.0/16tablecncipruleaddto60.23.0.0/16tablecnc第4页共52页第3页共52页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第4页共52页ipruleaddto60.3.0.0/16tablecncipruleaddto60.4.0.0/16tablecncipruleaddto60.5.0.0/16tablecncipruleaddt...