LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-25-2022, 01:40 PM   #1
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Rep: Reputation: 28
Masquerade Issue


I am having an iritating issue. i am rebuilding my server from scratch...putting the os on a new ssd. i am using fc37 server. i install the os, configure the network devices, one via dhcp, one via static ip and install it. i update it and everything works. i install dhcp. grab my old dhcpd.conf file and put it in its place...that starts up no issue. make sure the firewall is set to masquerade external nic. i restart it...everythings good. the dhcp passes out ips but i cannot connect to the internet from any other computer. it will not do it. i plugged in my old hd and everything worked as is but in fc37, it will not masquerade.
 
Old 12-25-2022, 01:51 PM   #2
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
my old os was fc31. man, this should work...
 
Old 12-25-2022, 01:57 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
Did you enable ip forwarding?
 
Old 12-25-2022, 02:04 PM   #4
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
no, i am do not need any ports forwarded...
 
Old 12-25-2022, 02:16 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
No the kernel variable ip_forward. It forwards packets from one network to another and is necessary if you want the system to act as a router.
 
Old 12-25-2022, 02:32 PM   #6
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
i have been at this for hours now...my eyes are bleeding...i didnt quite read the response right the first time. i did check that now and it was =1 on both...

# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
 
Old 12-25-2022, 02:35 PM   #7
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
just to be thorough, i did check selinux too.

setenforce 0

still didnt work...
 
Old 01-02-2023, 07:54 AM   #8
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
i finally figured this out. there were several compounding issues i had to work out to get to the root and after searching/thunking on it for a while, i got it. to figure it out on a dhcp client i ran...

ping 8.8.8.8 - everything good
ping google.com - packet filtered

that led me to searching on the firewall changes. one of them is the new iptables (nftables or whatever) which dont allow by default dhcp clients to masquerade so i ran...

firewall-cmd --zone=my_zone --add-source=192.168.0.0/24 (24 because my netmask is 255.255.255.0)

and it worked once again.
 
Old 01-14-2023, 10:08 AM   #9
baldur_1
Member
 
Registered: Sep 2010
Posts: 275

Original Poster
Rep: Reputation: 28
the above solution was not good. this is what you should do...

when i could not get masquerade yes on the firewall to work (i believe this is a bug), i added a source 192.168.0.0/24 to allow the under computers to access the internet. this caused all subsequent issues. as a result packets would go by the internal interface where samba was to external maybe or whatever and not mount right. i fixed this my adding a new policy that essentially, if not actually, did the maquerading...

firewall not configurable

Code:
firewall-cmd --zone=external --remove-source=192.168.0.0/24
to fix the pass-through...

to fix masquerade...

Code:
# firewall-cmd --permanent --new-policy intToExt
  # firewall-cmd --permanent --policy intToExt --set-target ACCEPT
  # firewall-cmd --permanent --policy intToExt --add-ingress-zone internal
  # firewall-cmd --permanent --policy intToExt --add-egress-zone external
  # firewall-cmd --reload
...and now everything works. i was able to samba mount again.
 
  


Reply



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
OpenVPN - IPtables Issue: Cannot insert NAT MASQUERADE Holdont Linux - Networking 4 11-06-2015 02:45 AM
sendmail masquerade help needed Rackemup Linux - General 2 03-05-2009 04:10 PM
masquerade question juan.villamil Linux - Networking 5 03-21-2002 05:39 AM
RedHat 7.1 iptables masquerade setup sromej Linux - Networking 1 07-13-2001 01:15 PM
setting up IP Masquerade for linux router tyler_durden Linux - Networking 3 06-26-2001 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:16 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