LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-29-2001, 03:38 PM   #1
GOLDF1NG3R
LQ Newbie
 
Registered: Jul 2001
Location: UK
Distribution: RH 7.1
Posts: 24

Rep: Reputation: 15
Iptables Masquerading


I am trying to setup ip masquerading on my home network but am having some troubles! My first machine (router) has two interfaces eth0,eth1. eth0 is on the internet, eth1 internal. I have tried to setup masquerading with the following rules.

iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

I have setup up another machine with this machine as it's gateway and tried to ping a server. I get:

Redirect Host(New nexthop: 10.255.255.254)
Destination Host unreachable

The routers IP is 10.116.0.1 (internal) which makes me wonder about the ip given for nexthop.

Sorry if this is messy or doesn't make much sense but i'm writing this using lynx on a console (due to this problem!)

Any help would be greatly appreciated!

Chris

Last edited by GOLDF1NG3R; 10-29-2001 at 04:12 PM.
 
Old 11-05-2001, 02:04 PM   #2
phek
Member
 
Registered: Jul 2001
Location: California, US
Distribution: Slackware
Posts: 196

Rep: Reputation: 30
hopefully you've got the problem fixed by now but if not, it sounds to me like you just need to change your subnet mask on the computer your trying to ping from to 10.255.255.255 instead of the x.x.x.254.
 
Old 11-10-2001, 11:02 AM   #3
[BHBS]=TK
Member
 
Registered: Aug 2001
Location: Salt Lake City, UT
Distribution: REDHAT 7.1
Posts: 32

Rep: Reputation: 15
Do you have ip forwarding enabled?

As stated above, make sure your netmask for server and clients are set correctly. Are you using DHCP or giving a static address to the client? Can you ping the client from the server?
 
Old 11-10-2001, 11:51 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
post the result of ifconfig and route -n on both computers.

and cat /proc/sys/net/ipv4/ip_forward on the server should be a 1

[root@alpha samba]# cat /proc/sys/net/ipv4/ip_forward
1


if not do this

echo 1 > /proc/sys/net/ipv4/ip_forward
 
  


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
iptables : masquerading not possible iamtux Linux - Networking 3 06-04-2005 11:32 PM
squid and iptables masquerading egyptian Linux - Security 1 09-05-2004 04:31 AM
iptables masquerading troubles caremaker Linux - Networking 6 01-07-2004 06:21 PM
iptables MASQUERADING at boot krishanprath Linux - Newbie 2 09-30-2003 07:41 AM
Iptables Masquerading GOLDF1NG3R Linux - Networking 4 11-01-2001 04:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:00 PM.

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