Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iproute2 и роутинг на 2 х провайдеров
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Russian
View previous topic :: View next topic  
Author Message
Drew82
n00b
n00b


Joined: 08 Apr 2005
Posts: 30

PostPosted: Sun Jun 11, 2006 12:46 pm    Post subject: iproute2 и роутинг на 2 х провайдеров Reply with quote

Ребят, кто может помочь?

Нужно всех роутить на провайдера2, а одного (192.168.80.166) - на провайдера1.

Code:
# cat /etc/conf.d/net

modules=( "iproute2" )

# provider 1
config_eth0=( "172.16.144.2/29" )

# LAN
config_eth1=( "192.168.80.1/24" )

# provider 2
config_eth2=( "84.47.176.189/25" )

routes_eth0=("172.16.144.0/29 via 172.16.144.1")
routes_eth1=("192.168.80.0/24 via 192.168.80.1")
routes_eth2=("default via 84.47.176.129")



Code:
# cat /etc/iproute2/rt_tables

255     local
254     main
253     default
0       unspec
200 isp1
210 isp2


Code:
# ip rule add from 192.168.80.166 table isp1
# ip rule ls
0:      from all lookup local
32765:  from 192.168.80.166 lookup isp1
32766:  from all lookup main
32767:  from all lookup default


Code:
# ip route add default via 172.16.144.1 dev eth0 table isp1
# ip route ls table isp1
default via 172.16.144.1 dev eth0


проверяем
Code:
# ip route flush cache
# ip route get 212.188.4.10 from 192.168.80.166 iif eth1
212.188.4.10 from 192.168.80.166 via 172.16.144.1 dev eth0  src 192.168.80.1
    cache <src-direct>  mtu 1500 advmss 1460 metric 10 64 iif eth1


когда пингуем 212.188.4.10 с 192.168.80.166 отвечает почему-то 84.47.176.189 (default gw):
Code:
15:53:18.418053 IP 192.168.80.166 > 212.188.4.10: ICMP echo request, id 768, seq 23040, length 40
15:53:21.421025 IP 84.47.176.189 > 192.168.80.166: ICMP 212.188.4.10 unreachable, length 68
15:53:21.422265 IP 192.168.80.166 > 212.188.4.10: ICMP echo request, id 768, seq 23296, length 40
15:53:24.425213 IP 84.47.176.189 > 192.168.80.166: ICMP 212.188.4.10 unreachable, length 68
15:53:24.426327 IP 192.168.80.166 > 212.188.4.10: ICMP echo request, id 768, seq 23552, length 40
15:53:27.429407 IP 84.47.176.189 > 192.168.80.166: ICMP 212.188.4.10 unreachable, length 68
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Russian 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