* Question: routing packets via specific router in LAN?
@ 2012-09-03 6:04 Yi Li
2012-09-03 8:28 ` Cong Wang
0 siblings, 1 reply; 2+ messages in thread
From: Yi Li @ 2012-09-03 6:04 UTC (permalink / raw)
To: netdev
Hi All,
I have server --- router ---client three machines,
and they all have only one ip in the same LAN.
I want to instruct the packets flowing through the router when the
server and client communicates.
I have do the following things to setup:
on the server:
# ip route add to unicast CLIENT_IP/32 via ROUTER_IP dev eth0
# echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
# echo 0 > /proc/sys/net/ipv4/conf/eth0/accept_redirects
on the client:
/*modify route table*/
# ip route add to unicast SERVER_IP/32 via ROUTER_IP dev eth0
/*disable icmp-redirects accept*/
# echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
# echo 0 > /proc/sys/net/ipv4/conf/eth0/accept_redirects
on the router:
/*enable forwarding*/
# echo 1 > /proc/sys/net/ipv4/ip_forwarding
/*disable icmp-redirects*/
# echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
# echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects
BTW, I have disabled iptables on all of these three machines.
But I still can't tcpdump any packets on the router which means no
packets flowing
through the router. The server and client communicates by pass the router!
So, What I have missed, or we can't setup server-router-client topo in LAN?
Thanks in advaced.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question: routing packets via specific router in LAN?
2012-09-03 6:04 Question: routing packets via specific router in LAN? Yi Li
@ 2012-09-03 8:28 ` Cong Wang
0 siblings, 0 replies; 2+ messages in thread
From: Cong Wang @ 2012-09-03 8:28 UTC (permalink / raw)
To: netdev
On Mon, 03 Sep 2012 at 06:04 GMT, Yi Li <lovelylich@gmail.com> wrote:
> Hi All,
> I have server --- router ---client three machines,
> and they all have only one ip in the same LAN.
> I want to instruct the packets flowing through the router when the
> server and client communicates.
> I have do the following things to setup:
> on the server:
> # ip route add to unicast CLIENT_IP/32 via ROUTER_IP dev eth0
> # echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
> # echo 0 > /proc/sys/net/ipv4/conf/eth0/accept_redirects
>
> on the client:
> /*modify route table*/
> # ip route add to unicast SERVER_IP/32 via ROUTER_IP dev eth0
> /*disable icmp-redirects accept*/
> # echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects
> # echo 0 > /proc/sys/net/ipv4/conf/eth0/accept_redirects
>
> on the router:
> /*enable forwarding*/
> # echo 1 > /proc/sys/net/ipv4/ip_forwarding
> /*disable icmp-redirects*/
> # echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects
> # echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects
>
Try to add some iptables rules like:
iptables -A FORWARD -j ACCEPT -s CLIENT_IP/xx -d SERVER_IP/xx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-03 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03 6:04 Question: routing packets via specific router in LAN? Yi Li
2012-09-03 8:28 ` Cong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).