1、网络都牝褊川拓扑图:网络环境说明1.eth1连接上网线路1,上网线路1网关为192.168.10.1/24,DNS为192.168.10.12.eth2连接上网线路2,上网线路2网关为192.168.20.1/24,DNS为192.168.20.13.配置eth1/eth2分别为wan1和wan2,IP地址分别配置为192.168.10.100/24和192.168.20.200/244.配置eth4为Lan,IP地址分别配置为172.18.1.1/245.配置eth1/eth2做NAT6.配置eth4做DNS转发接口
2、EdgeRouter基础配置1.配置eth1/eth2为WAN1/WAN2,IP地址分别配置为192.168.10.100/24和192.168.20.200/24
3、分别配置eth1/eth2的默认路由网关为192.168.10.1/24和192.168.20.1/24
4、分配配置eth1/eth2的上网线路DNS为192.168.10.1/24和192.168.20.1/24
5、分别配置eth1/eth2做NAT
6、配置eth4为LAN,IP地址分别配置为172.18.1.1/24
7、配置DHCP-LAN172.18.1.10-172.18.1.200
8、将eth4加入到DNS转发接口
9、EdgeRouter配置端口策略路由1.电脑连接eth4并获得172.18.1.X/24的IP地址,通过ssh访问EdgeRouter管理IP172.18.1.1
10、输入EdgeRouter管理员账号密码登入,并输入configure进入配置模式3.输入如下命令行配置2邗锒凳审个子路由器表出口set protocols static table 1 route 0.0.0.0/0next-hop 192.168.10.1set protocols static table 2 route 0.0.0.0/0next-hop 192.168.20.14.输入如下命令配置端口80的流量走上网线路1即从eth1-192.168.10.100接口路由出口set firewall modify out rule 10 description 'use table1 for 80'set firewall modify out rule 10 protocol tcpset firewall modify out rule 10 destination port 80set firewall modify out rule 10 modify table 15.输入如下命令配置其它非80端口流量走上网线路2即从eth2-192.168.20.200接口路由出口set firewall modify out rule 20 description 'everything except 80'set firewall modify out rule 20 modify table 26.配置策略路由接口为eth4.in即LAN.in接口set interfaces ethernet eth4 firewall inmodify out7.输入commit配置生效,并输入save保存配置commitsave
11、LAN客户端测试1.通过浏览器访问www.youku.com,也就是访问youku的80端口,该数据流量走eth1上网线路1
12、通过浏览器访问https://X.X.X.X:8443,也就是访问X.X.X.X的8443端口,该数据流量走eth2上网线路2
13、先拔掉eth1的上网线路,再通过浏览器访问www.youku.com,也就是访问youku的80端口,该数据流量走eth2上网线路2