Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jul 21, 2008 12:45 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
first linode:
iface eth0 inet static
address 207.192.*.*
netmask 255.255.255.0
gateway 207.192.72.1
iface eth1 inet static
address 192.168.133.*
netmask 255.255.128.0

echo 1 >/proc/sys/net/ipv4/ip_forward
cat /proc/sys/net/ipv4/ip_forward
result is 1
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.128.0/17 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.128.0/17 -j SNAT --to-source 207.192.*.*(first public ip)


secenod linode:
iface eth0 inet static
address 207.192.*.*
netmask 255.255.255.0
gateway 207.192.72.1
iface eth1 inet static
address 192.168.133.*
netmask 255.255.128.0

route add -net 192.168.128.0/17 gw 192.168.133.*(first private ip)

Below is the route table:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
207.192.73.0 * 255.255.255.0 U 0 0 0 eth0
192.168.128.0 192.168.133.* 255.255.128.0 UG 0 0 0 eth1
192.168.128.0 * 255.255.128.0 U 0 0 0 eth1
default gateway37.linod 0.0.0.0 UG 0 0 0 eth0


>>>>This explains that route and gateway is right

ping first-private-ip is ok
ping 207.192.72.1 -I eth1 is ok
traceroute 207.192.72.1 ok
traceroute -i eth0 207.192.72.1 ok
traceroute -i eth1 207.192.72.1 fail


>>>>This explains that Private IP act as gateway for another Private ip has fail!!
>>>>can anybody help me?


Last edited by kotter on Mon Jul 21, 2008 1:01 pm, edited 1 time in total.

Top
   
 Post subject: iptables --list -t nat
PostPosted: Mon Jul 21, 2008 12:58 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
in first lindo
iptables --list -t nat

Chain PREROUTING (policy ACCEPT)
target prot opt source destination
nat_in 0 -- anywhere anywhere

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
nat_out 0 -- anywhere anywhere
eth0_masq 0 -- anywhere anywhere
SNAT 0 -- 192.168.128.0/17 anywhere to:207.192.72.*(my ip)
MASQUERADE 0 -- 192.168.128.0/17 anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain eth0_masq (1 references)
target prot opt source destination
MASQUERADE 0 -- 192.168.128.0/17 anywhere policy match dir out pol none

Chain nat_in (1 references)
target prot opt source destination
DNAT 0 -- anywhere li36-35.members.linode.com policy match dir in pol none to:192.168.133.*

Chain nat_out (1 references)
target prot opt source destination
SNAT 0 -- 192.168.133.* anywhere policy match dir out pol none to:207.192.72.*


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 2:45 pm 
Offline
Junior Member

Joined: Sun Dec 02, 2007 1:17 am
Posts: 27
Website: http://www.nabber.org
It might help if you explain what you are trying to do with this configuration. And what does your failed traceroute actually output?

My guess is that right now traceroute just fails because it can't find a route in your routing table. When you specify -i eth1 that limits you to:

192.168.128.0 192.168.133.* 255.255.128.0 UG 0 0 0 eth1
192.168.128.0 * 255.255.128.0 U 0 0 0 eth1

Since your destination address is not in the 192.168 subnet it will fail. My guess is you want to specify a secondary default gateway using eth1 and your 192.168 gateway address.


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 2:54 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
i have disable public ip on second lindo's eth0,defaulu gateway is first linode's private ip,but cant not ping ,traceroute is fail too.


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 4:20 pm 
Offline
Junior Member

Joined: Sun Dec 02, 2007 1:17 am
Posts: 27
Website: http://www.nabber.org
Can you give us a routing table update then?


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 4:26 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.128.0 * 255.255.128.0 U 0 0 0 eth1
default 192.168.133.20 0.0.0.0 UG 0 0 0 eth1


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 4:27 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
I ssh to second lindo through first lindo.


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 4:29 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
i make it success very easy on my pc.that only need "apt get install ipmasq" ,
i study the iptables -L result careful? i believe my lindo's iptables'configure is correct.

i have ifconfig down eth0 ,only eth1 is up.

tcpdump record only dispay "arp who has..,reply to...",

is lindo's private network something about arp is disabled?


Top
   
 Post subject:
PostPosted: Wed Jul 23, 2008 11:10 pm 
Offline
Junior Member

Joined: Sun Dec 02, 2007 1:17 am
Posts: 27
Website: http://www.nabber.org
I just use a one-liner when I do NAT, you might want to try just this to start:

iptables --table nat --append POSTROUTING -s 192.168.0.0/16 -o eth0 -j MASQUERADE

Also you should probably trying turning off all of your iptables NAT stuff and see if you can to a normal ping between linodes. If that doesn't work, NAT won't work for sure.


Top
   
 Post subject:
PostPosted: Fri Jul 25, 2008 10:38 am 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
i have give up.
this is a easy thing in a linux server,but in linode ,it can not.
i ensure there is something is disabled in lindo's private network.


Top
   
 Post subject:
PostPosted: Fri Jul 25, 2008 1:12 pm 
Offline
Senior Member

Joined: Tue Jan 22, 2008 2:10 am
Posts: 103
For security reasons, all network interfaces (including the private net) are filtered to only be able to send packets on their own IP addresses.

If you want to masquerade through the private net, you will need to establish an IP-in-IP tunnel. Although I'm not sure why you'd want to.


Top
   
 Post subject:
PostPosted: Fri Jul 25, 2008 1:21 pm 
Offline
Senior Newbie

Joined: Mon Jul 21, 2008 12:28 pm
Posts: 8
WLM: peterlee169@hotmail.com
bdonlan wrote:
For security reasons, all network interfaces (including the private net) are filtered to only be able to send packets on their own IP addresses.

If you want to masquerade through the private net, you will need to establish an IP-in-IP tunnel. Although I'm not sure why you'd want to.


this is the reason,
but i have remove the second lindo form my account


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group