
192.168.1.1
eth0 网卡 eth1网卡
lan:192.168.0.251 wan1口: 192.168.1.8
思路:
准备2块网卡 #内网、
1.)内网我设置为:192.168.0.251 http://192.168.0.251下载登陆器 通过winbox登录设置
2.)路由表:除了2个直连 还要添加 目标0.0.0.0/0 网关 192.168.1.1 静态网关
3.)启用NAT
1.)>ip address
ip address>add address =192.168.0.251/24
ip address>Interface =eth0
ip address add address =192.168.1.8/24 interface=eth1
Interface>set eth0 name=lan 可将eth0名称改为lan
2.)
3.)Src 源地址 Dst目的
1. Chain :srcnat 源nat
Src.Address:192.168.0.0/24 源地址
Out.interface: wan (eth1) 输出接口
Action作用: masquerade地址欺骗 口ip是多少 ip就是多少 (注释:192.168段地址将被欺骗成wan(eth1)口当前的地址)
2. Chain :srcnat
Src.Address:192.168.0.0/24 源地址
Action作用: Src-nat
To Addresses:192.168.1.9
3. Chain :srcnat 源nat
Action作用: masquerade地址欺骗
直接可以上网了
Ps:pppoe的话 安装pppoe包
1.ppp-添加接口-Genral-interface-选卡 wan
2.然后如图
就可以上网了...
