Routing packets back from incoming interface
There is a known issue (it is a design issue) with Linux networking stack. If you have multiple interface to connect wan side, for example ppp0 is dialup, eth0 leased line, wlan0 wireless etc. normally you have 3 default routing entry also. In this case, if a packet arrives from ppp0 interface, their reply packets sent from default router and it can be wlan0 interface. So, connection can't be established.
To solve this problem, reply packets must be return back with same interface. If packet arrives from ppp0 interface, their replies also must sent from ppp0 interface too.
To do this, we'll use iproute package. First of all, a routing table entry must be created:
echo 101 Tppp0 >> /etc/iproute2/rt_tables
Second, we have to say ppp0 packets routed by the Tppp0 table:
ip rule add dev ppp0 table Tppp0
And we have to say that table Tppp0's default router is the default router of ppp0 interface:
ip route add default dev ppp0 table Tppp0
Last, we can flush routing cache:
ip route flush cache
You can repeat above steps for other interfaces too. If so, you have to give a uniq id between 0-255 when creating new table entries in rt_tables file.
Please note that, this is most simple solution and you can make too different / complex setup for different policy routing needs with iproute.
- 0 Comment
- Murat Demirten
- 15 Aug 2008, 12:25
-
You must be login first or sign-up for an account to post comments.
USERBOX
CATEGORIES
MOST READ TODAY
- Redirecting tcp / udp ports with socat
- Syntax highlighting in less
- Disabling reverse dns lookups in ssh
- Passwordless sudo setup
- Users with /bin/false shell to login on vsftpd
- Scp resume
- Using lsof utility
- dropbear rsa key problem
- Lowercase Table Names in MySQL
- XFS Filesystem has duplicate UUID problem
LAST ADDED
- Using iPhone internet sharing over bluetooth under Linux
- Using USB sound card with amarok
- Multi-conditional search and replace (clearing a ftp trojan script example)
- Disabling ipv6 functionality
- How to convert a mp3 file
- How to choose the fastest Debian mirror
- Disabling reverse dns lookups in ssh
- Rewriting destination ip address
- Deleting A File By It's Inode Value
- Learning which libraries are used for a binary
