

给不同的L2TP用户分配固定IP
//下面主要是给用户绑定一个固定IP地址,使那个用户每次L2TP拔号获取的IP都是同一个IP地址,然后断开l2tp用户连接, 等待客户端重新连接后,就会分配绑定的那个固定IP地址了,以便设置固定的路由,
第1步是绑定固定IP地址,
[qinxiu]aaa
[qinxiu-aaa]local-user moossy bind-ip 192.168.21.200 //好像只有PPP用户能够绑定固定IP,其他用户不能
Info: After changing the rights (including the password, access type, FTP direct
ory, bind IP, and level) of a local user, the rights of users already online do
not change. The change takes effect to users who go online after the change.
[qinxiu-aaa]q
第2步是查看通道名称,然后通过名称断开L2TP的连接,
[qinxiu]dis l2tp tunnel
Total tunnel : 2
LocalTID RemoteTID RemoteAddress Port Sessions RemoteName
1 32387 113.12.173.211 1701 1 HGW
4 10 113.12.173.176 49082 1 gaoxin
[qinxiu]retset l2tp tunnel peer-name gaoxin
^
Error: Unrecognized command found at '^' position.
[qinxiu]q //需要回到用户视图下才能断开L2TP连接,
<qinxiu>reset l2tp tunnel peer-name gaoxin //断开名为goxin,L2TP连接,
Info: Clear the tunnel, remote name = gaoxin.
<qinxiu>dis l2tp session
Total session : 2
LocalSID RemoteSID LocalTID Interface LclTAddr RmtTAddr LclSAddr RmtSAddr
1 1 6 Virtual-Template1:0 220.173.38.95 113.12.173.176 192.168.21.1 192.168.21.200
2 1655 1 Virtual-Template1:1 220.173.38.95 113.12.173.211 192.168.21.1 192.168.21.81
最后一步是设置固定的路由
[qinxiu]ip route-static 192.168.8.0 24 192.168.21.200 //添加一个静态路由,
[qinxiu]dis ip routing-table //该命令表示查看路由表,