LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2015, 04:49 AM   #1
COZSMIN
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Rep: Reputation: 0
Iptables send back to client unadequate route


Hello

this is my setup


internet <---- company-gateway <-- iptables-gw <--clients wanting to connect

In this setup the company gateway only allows a few IPs to connect , if i virtualise a machine it must go thru my ip , and it must have an IP from the company network so no nat or other stuff

Iptables rules :

NAT:
-I POSTROUTING -j SNAT -o eth0 --to-destination $eth0_ip
FILTER:
-I FORWARD -j ACCEPT

sysct :
net.ipv4.ip_forward = 1
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.eth0.forwarding = 1

Now the client has default route my $eth0_ip ,
but at ping i get :

( NOTE $eth0_ip is the IP of my linux that acts as second gateway )

root@vm_1:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From $eth0_ip: icmp_seq=1 Redirect Network(New nexthop: $company_gateway )
From $company_gateway icmp_seq=1 Destination Host Prohibited
From $eth0_ip: icmp_seq=2 Redirect Network(New nexthop: $comp_gw)
From $cmp_gw : icmp_seq=2 Destination Host Prohibited

So the kernel is redirecting the packets to $company_gw , instead i want it to forward the packets ( don't send another "better" gateway ) , i just don't need it to think for me , i do it instead and i know what route to take
 
Old 08-25-2015, 05:23 AM   #2
COZSMIN
LQ Newbie
 
Registered: Apr 2008
Posts: 8

Original Poster
Rep: Reputation: 0
SOLVED

if anyone cares i forgot to load the settings , so *nat rules were off. BEST EVERYONE
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Route eth2 TCP packets to tun0 with IPTABLES & IP RULE/ROUTE Thireus Linux - Networking 4 05-09-2011 12:38 PM
Web: How to send html information back and forth windows... client side only. RHLinuxGUY Programming 3 02-16-2007 07:29 PM
How to make iptables(NAT) not to send RST back attojung Linux - Networking 2 01-10-2007 07:46 AM
DHCP Suse 9.2 Server wont route pings back to client mikfig Linux - Networking 2 01-12-2005 03:13 PM
Route dialup modem packets back through dialup instead of default route cable modem jogress Linux - Networking 1 10-21-2003 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration