Dear all,

We are developing a new router. It has 2 ethernet ports(1 for LAN and 1 for WAN connection). It runs Linux Kernel 2.4.18 as operating system.

We are implementing diff service making using using tc command. But we are facing problem while marking required packets which is explained below with an example.

Setup: Router is having following setup
Router LAN IP: 192.168.1.156
Router WAN 1 IP: 122.181.1.122
Setup: Router is connected with 2 PCs. One PC is connected to LAN side another to WAN side of ICM. Both PC are booted with LINUX os (cent os)
LAN side PC ip: 192.168.1.18
WAN side PC ip: 122.181.1.121

Rule applied :
1. All packets with destination ip 192.168.1.18 should mark with dscp value 0x17.
2. All packets with destination ip 122.181.1.121 should mark with dscp value 0x21.

Tc commands used to add rules:
tc qdisc add dev eth0 root handle 1: dsmark indices 16 default_index 15 set_tc_index
tc qdisc add dev waneth0 root handle 2: dsmark indices 16 default_index 15 set_tc_index
tc class change dev eth0 classid 1:1 dsmark mask 0x0 value 0x17
tc class change dev eth0 classid 2:1 dsmark mask 0x0 value 0x21
tc filter add dev eth0 parent 1:0 protocol ip prio 1 u32 match ip dst 192.168.1.18 flowid 1:1
tc filter add dev eth0 parent 2:0 protocol ip prio 1 u32 match ip dst 122.181.1.121 flowid 1:1

Test cases:
case a:
Router web pages are viewed through LAN side PC. In LAN side PC it is observed that all packets reaching from 192.168.1.156 contains TOS field value 0x17.

case b:
Router web pages are viewed through WAN side PC. In WAN side PC it is observed that all packets reaching from 122.181.1.122 contains TOS field value 0x21.

case c:
WAN side PC web pages are viewed through LAN side PC through router. In LAN side PC it is observed that all packets reaching from 122.181.1.121 does not contains TOS field value as 0x17.

Can any one help us to solve this problem? Is any command is to be added to enable ds marking for routing packets?

Thanks in advance.

with regards,
Rags