zt-Simple source policy routing
原文地址: http://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.simple.html
4.1. Simple source policy routing
Let's take a real example once again, I have 2 (actually 3, about time I returned them) cable modems, connected to a Linux NAT ('masquerading') router. People living here pay me to use the Internet. Suppose one of my house mates only visits hotmail and wants to pay less. This is fine with me, but they'll end up using the low-end cable modem.
The 'fast' cable modem is known as 212.64.94.251 and is a PPP link to 212.64.94.1. The 'slow' cable modem is known by various ip addresses, 212.64.78.148 in this example and is a link to 195.96.98.253.
The local table:
[ahu@home ahu]$ ip route list table local |
Lots of obvious things, but things that need to be specified somewhere. Well, here they are. The default table is empty.
Let's view the 'main' table:
[ahu@home ahu]$ ip route list table main |
We now generate a new rule which we call 'John', for our hypothetical house mate. Although we can work with pure numbers, it's far easier if we add our tables to /etc/iproute2/rt_tables.
# echo 200 John >> /etc/iproute2/rt_tables |
Now all that is left is to generate John's table, and flush the route cache:
# ip route add default via 195.96.98.253 dev ppp2 table John |
And we are done. It is left as an exercise for the reader to implement this in ip-up.
zt-Simple source policy routing的更多相关文章
- A Quick Introduction to Linux Policy Routing
A Quick Introduction to Linux Policy Routing 29 May 2013 In this post, I’m going to introduce you to ...
- iproute2学习笔记
一.替代arp, ifconfig, route等命令 显示网卡和IP地址 root@openstack:~# ip link list 1: lo: <LOOPBACK,UP,LOWER_UP ...
- partial.js client-side routing(客户端路由-基于HTML5 SPA特性的历史API)
partial.js client-side routing https://github.com/petersirka/partial.js-clientside Framework support ...
- (转)RL — Policy Gradient Explained
RL — Policy Gradient Explained 2019-05-02 21:12:57 This blog is copied from: https://medium.com/@jon ...
- Source Insight 中的 Auto Indenting
编码过程中,希望输入花括号时能自动对齐,Source Insigth 应如何设置? 先来看一下Source Insight 中的帮助. “ Auto Indenting The auto-indent ...
- Linux就这个范儿 第16章 谁都可以从头再来--从头开始编译一套Linux系统 nsswitch.conf配置文件
Linux就这个范儿 第16章 谁都可以从头再来--从头开始编译一套Linux系统 nsswitch.conf配置文件 朋友们,今天我对你们说,在此时此刻,我们虽然遭受种种困难和挫折,我仍然有一个梦 ...
- Cisco IOS Debug Command Reference I through L
debug iapp through debug ip ftp debug iapp : to begin debugging of IAPP operations(in privileged EXE ...
- vyos User Guide
vyos User Guide 来源 https://wiki.vyos.net/wiki/User_Guide The VyOS User Guide is focused on providing ...
- OPENVPN2.3配置文档官方说明
openvpn Section: Maintenance Commands (8)Index NAME openvpn - secure IP tunnel daemon. SYNOPSIS open ...
随机推荐
- python模块介绍- SocketServer 网络服务框架
来源:https://my.oschina.net/u/1433482/blog/190612 摘要: SocketServer简化了网络服务器的编写.它有4个类:TCPServer,UDPServe ...
- 今年几个项目中用到的一个jqueryTab插件感觉挺好用的
名字叫:wdscrolltab 开源中国项目地址: http://www.oschina.net/p/wdscrolltab
- 双击vbs时,默认cscript运行脚本
Dim obj_shellset obj_shell = createobject("wscript.shell")host = WScript.FullNameIf LCase( ...
- 2008server安装Intel I217V网卡驱动
问题:由于在职的是小公司,公司服务器都是DIY的,拒绝采购品牌服务器,所以配件都是自己DIY的,这样就会出现很多兼容性问题,例如服务器主板是AUS B85-PRO-Gamer,装的是服务器系统wind ...
- 初学matlab----函数用法(随学习更新中)
sort(A) 若A是向量不管是列还是行向量,默认都是对A进行升序排列. sort(A)是默认的升序,而sort(A,'descend')是降序排序. sort(A)若A是矩阵,默认对A的各列进行升序 ...
- 【转】awk、nawk、mawk、gawk的简答介绍
来自http://blog.sina.com.cn/s/blog_3d2d79aa0100h47h.html awk 是一种编程语言,用于在linux/unix下对文本和数据进行处理.数据可以来自标准 ...
- mysql 重复数据防止插入:)
insert into table (id, name, age) values(1, "A", 19) on duplicate key update name=values(n ...
- CSS3常用选择器(一)
在 CSS 中,选择器是一种模式,用于选择需要添加样式的元素.比如最常用到的#id,.class,标签选择器. 随着CSS3到来,增加了很多新型选择器,这里就常用的做一个总结. 1.属性选择器. 在c ...
- MFCC matlab code
%function ccc=mfcc(x) %归一化mel滤波器组系数 filename=input('input filename:','s'); [x,fs,bits]=wavread(filen ...
- memory allocation
1 malloc与free是C++/C语言的标准库函数,new/delete是C++的运算符. 2,malloc, 必须 包含头文件<stdlib.h> 3, nt* p_scalar = ...