r # Put any custom (iptables) rules here down below: ################################################## # Let's make sure some modules we might need get # loaded - Marco #modprobe sch_cake #modprobe act_mirred cpupower frequency-set -g performance cpupower idle-set -D 0 # make sure ethernet adapaters are configured the # way I like and for low latency - Marco ethtool -A eth0 autoneg off rx off tx off ethtool -A eth1 autoneg off rx off tx off ethtool -A eth2 autoneg off rx off tx off ethtool -K eth0 rx on tx on sg on tso on gso on gro on rxvlan on txvlan on rxhash on ethtool -K eth1 rx on tx on sg on tso on gso on gro on rxvlan on txvlan on rxhash on ethtool -K eth2 rx on tx on sg on tso on gso on gro on rxvlan on txvlan on rxhash on ethtool -G eth0 rx 1024 tx 1024 ethtool -G eth1 rx 1024 tx 1024 ethtool -G eth2 rx 1024 tx 1024 ethtool -L eth0 combined 2 ethtool -L eth1 combined 2 ethtool -L eth2 combined 2 ethtool -K eth0 ntuple on ethtool -K eth1 ntuple on ethtool -K eth2 ntuple on ethtool -C eth0 rx-usecs 0 tx-usecs 0 ethtool -C eth1 rx-usecs 0 tx-usecs 0 ethtool -C eth2 rx-usecs 0 tx-usecs 0 ethtool -X eth0 equal 2 ethtool -X eth1 equal 2 ethtool -X eth2 equal 2 ethtool -N eth0 rx-flow-hash udp4 sdfn ethtool -N eth1 rx-flow-hash udp4 sdfn ethtool -N eth2 rx-flow-hash udp4 sdfn ip link set eth0 txqueuelen 1024 ip link set eth1 txqueuelen 1024 ip link set eth2 txqueuelen 1024 /usr/sbin/network-irq-affinity #iptables -t mangle -N MARK-SPECTRUM #iptables -t mangle -A MARK-SPECTRUM -j MARK --set-mark 1 #iptables -t mangle -A MARK-SPECTRUM -j CONNMARK --save-mark #iptables -t mangle -N MARK-FIOS #iptables -t mangle -A MARK-FIOS -j MARK --set-mark 2 #iptables -t mangle -A MARK-FIOS -j CONNMARK --save-mark #iptables -t mangle -A PREROUTING -i eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j CONNMARK --restore-mark #iptables -t mangle -A PREROUTING -i eth0 -m conntrack --ctstate NEW -m statistic --mode nth --every 2 --packet 0 -j MARK-SPECTRUM #iptables -t mangle -A PREROUTING -i eth0 -m conntrack --ctstate NEW -m statistic --mode nth --every 2 --packet 1 -j MARK-FIOS #iptables -A PREROUTING -i eth0 -t mangle -j MARK --set-mark 1 #iptables -A PREROUTING -i eth2 -t mangle -j MARK --set-mark 2 #ip rule del from all fwmark 2 2>/dev/null #ip rule del from all fwmark 1 2>/dev/null ip route del 192.168.100.1/32 dev eth0 ip rule del from 192.168.10.101 table FIOS prio 1 ip rule del to 192.168.10.101 table FIOS prio 2 ip rule del from 192.168.10.101 table SPECTRUM prio 1 ip rule del to 192.168.10.101 table SPECTRUM prio 2 ip rule del from 192.168.10.118 table SPECTRUM prio 3 ip rule del to 192.168.10.118 table SPECTRUM prio 4 ip rule del from 192.168.10.71 table FIOS prio 7 ip rule del to 192.168.10.71 table FIOS prio 8 ip rule del from 192.168.10.71 table SPECTRUM prio 7 ip rule del to 192.168.10.71 table SPECTRUM prio 8 ip rule del from 192.168.10.112 table FIOS prio 9 ip rule del to 192.168.10.112 table FIOS prio 10 ip rule del from 192.168.10.132 table FIOS prio 11 ip rule del to 192.168.10.132 table FIOS prio 12 ip rule del from 192.168.10.134 table FIOS prio 13 ip rule del to 192.168.10.134 table FIOS prio 14 ip rule del from 192.168.10.207 table FIOS prio 15 ip rule del to 192.168.10.207 table FIOS prio 16 ip rule del from 192.168.10.131 table SPECTRUM prio 17 ip rule del to 192.168.10.131 table SPECTRUM prio 18 ip rule del from 192.168.10.131 table FIOS prio 17 ip rule del to 192.168.10.131 table FIOS prio 18 ip rule del from 192.168.10.119 table FIOS prio 19 ip rule del to 192.168.10.119 table FIOS prio 20 ip rule del from 192.168.10.206 table SPECTRUM prio 21 ip rule del to 192.168.10.206 table SPECTRUM prio 22 ip rule del from 192.168.10.140 table FIOS prio 23 ip rule del to 192.168.10.140 table FIOS prio 24 ip rule del from 192.168.10.66 table FIOS prio 25 ip rule del to 192.168.10.66 table FIOS prio 26 ip rule add from 192.168.10.101 table FIOS prio 1 ip rule add to 192.168.10.101 table FIOS prio 2 #ip rule add from 192.168.10.101 table SPECTRUM prio 1 #ip rule add to 192.168.10.101 table SPECTRUM prio 2 ip rule add from 192.168.10.118 table SPECTRUM prio 3 ip rule add to 192.168.10.118 table SPECTRUM prio 4 ip rule add from 192.168.10.71 table FIOS prio 7 ip rule add to 192.168.10.71 table FIOS prio 8 #ip rule add from 192.168.10.71 table SPECTRUM prio 7 #ip rule add to 192.168.10.71 table SPECTRUM prio 8 ip rule add from 192.168.10.112 table FIOS prio 9 ip rule add to 192.168.10.112 table FIOS prio 10 ip rule add from 192.168.10.132 table FIOS prio 11 ip rule add to 192.168.10.132 table FIOS prio 12 ip rule add from 192.168.10.134 table FIOS prio 13 ip rule add to 192.168.10.134 table FIOS prio 14 ip rule add from 192.168.10.207 table FIOS prio 15 ip rule add to 192.168.10.207 table FIOS prio 16 ip rule add from 192.168.10.131 table SPECTRUM prio 17 ip rule add to 192.168.10.131 table SPECTRUM prio 18 #ip rule add from 192.168.10.131 table FIOS prio 17 #ip rule add to 192.168.10.131 table FIOS prio 18 ip rule add from 192.168.10.119 table FIOS prio 19 ip rule add to 192.168.10.119 table FIOS prio 20 ip rule add from 192.168.10.206 table SPECTRUM prio 21 ip rule add to 192.168.10.206 table SPECTRUM prio 22 ip rule add from 192.168.10.140 table FIOS prio 23 ip rule add to 192.168.10.140 table FIOS prio 24 ip rule add from 192.168.10.66 table FIOS prio 25 ip rule add to 192.168.10.66 table FIOS prio 26 # flush the routing table ip route flush cache tc qdisc delete dev eth0 ingress tc qdisc delete dev eth0 root tc qdisc delete dev ifb4eth0 root ip link set ifb4eth0 down ip link del name ifb4eth0 tc qdisc delete dev eth2 ingress tc qdisc delete dev eth2 root tc qdisc delete dev ifb4eth2 root ip link set ifb4eth2 down ip link del name ifb4eth2 ### egress tc qdisc add dev eth0 root cake bandwidth 30mbit besteffort dual-srchost nat docsis wash tc qdisc add dev eth2 root cake bandwidth 920mbit mpu 64 overhead 26 dual-srchost nat #tc qdisc add dev eth2 root cake bandwidth 500mbit ethernet hosts nat ack-filter ### ### ingress ip link add name ifb4eth0 type ifb tc qdisc add dev eth0 handle ffff: ingress tc qdisc add dev ifb4eth0 root cake bandwidth 920mbit besteffort dual-dsthost nat docsis wash ip link set ifb4eth0 up tc filter add dev eth0 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth0 ip link add name ifb4eth2 type ifb tc qdisc add dev eth2 handle ffff: ingress tc qdisc add dev ifb4eth2 root cake bandwidth 920mbit mpu 64 overhead 26 dual-dsthost nat ip link set ifb4eth2 up tc filter add dev eth2 parent ffff: protocol all prio 10 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ifb4eth2 ### sysctl -p ###