Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dnsmasq , 2 ppp connections, route through just ppp1
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
adriansi7
n00b
n00b


Joined: 02 May 2009
Posts: 12

PostPosted: Wed Jan 26, 2011 12:39 pm    Post subject: dnsmasq , 2 ppp connections, route through just ppp1 Reply with quote

Hello! on my gentoo box i have two ethernet cards : eth0 and eth1 . Eth0 is used for WAN connections : ppp0 and ppp1 links through eth0. The ppp connections are from the same isp and uses the same dns server 172.16.1.1.
The eth1 card is used for lan connections , i have dnsmasq running on eth1 with a DHCP range 192.168.0.2, 192.168.0.6 . The lan machines are going out through ppp0 which is the default dateway , can you please tell me how to make all traffic from dnsmasq and lan connections go out through ppp1 ? I want only dnsmasq with all dhcp clients to go out through ppp1 , and the rest of the services like apache , etc to use the ppp0 as they use it now . Thank you !
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Jan 26, 2011 1:21 pm    Post subject: Reply with quote

not sure about your exact needs, but apache and other service are running on the gentoo box right?

If so you could probably do some source routing:
  • create an alternate routing table with ppp1 as the default gw
  • add a rule to match the lan in the source address to tell the kernel to use the alternate routing table
  • use the following dnsmasq syntax to make it query the NS through ppp1
    Code:
    --server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source-ip>|<interface>[#<port>]]


:?:
_________________
The End of the Internet!
Back to top
View user's profile Send private message
adriansi7
n00b
n00b


Joined: 02 May 2009
Posts: 12

PostPosted: Wed Jan 26, 2011 1:54 pm    Post subject: Reply with quote

not sure i understand you . on my gentoo box i have apache and other services which uses the default gateway ppp0.

I want only dnsmasq and its clients with ip range 192.168.0.2 - 192.168.0.6 to use ppp1 as gateway .

This is my route -n output :

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.1.1      0.0.0.0         255.255.255.255 UH    0      0        0 ppp1
172.16.1.1      0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         172.16.1.1      0.0.0.0         UG    0      0        0 ppp0


Can you please tell what rules i have to add to the route and iptables ? Thank you !
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Thu Jan 27, 2011 8:01 am    Post subject: Reply with quote

try looking for examples on how to use iproute2 to do some source routing, and then you should understand what I was suggesting.
_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum