LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2018, 05:30 AM   #1
broadjos
LQ Newbie
 
Registered: Oct 2018
Posts: 2

Rep: Reputation: Disabled
Iptables on gateway


1)..................................
I hav several clients to this gw.
I want to use IPTABLES for firewall. I downloaded n installed.
iptables comand is working on prompt.

linux> service iptables status
service: no such service iptables

what could be problem???

2)---------------------------

Also if i flush iptables tables to write my own, thn this comp is getting disconnected from LAN

linux> ping 172.31.1.1
PING 172.31.1.1 (172.31.1.1) 56(84) bytes of data.
64 bytes from 172.31.1.1: icmp_seq=1 ttl=63 time=0.517 ms
64 bytes from 172.31.1.1: icmp_seq=2 ttl=63 time=0.501 ms
64 bytes from 172.31.1.1: icmp_seq=3 ttl=63 time=0.504 ms

--- 172.31.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.501/0.507/0.517/0.019 ms

linux> iptables -F
linux> ping 172.31.1.1
no response
............................................
 
Old 10-16-2018, 10:18 AM   #2
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 262

Rep: Reputation: 94
1) What is your distribution ?
Because you may have to install a package and you should probably use systemd command.

2) What are your iptables rules and your network config ?
 
Old 10-16-2018, 05:18 PM   #3
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 251

Rep: Reputation: Disabled
Not knowing your distribution is a problem. My guess, speaking generically, is that you have iptables installed but not an iptables-services package which would give you the services file required to run it under systemd. Flushing your rules should leave your policies intact. What are they? I'll bet they are DROP across the board. That would certainly do it. Try running iptables -L -v -n --line-numbers > rules as root (or sudo or the equivalent) and then look at the file named rules. That should tell you a lot including your policies.

You probably should either install iptables-services or write your own services file. It isn't that hard to write a simple one. Look at a few .service files on your computer until you find a fairly simple one you can copy and modify. Most of the commands are pretty obvious but looking at the man page for systemd should get you started. Remember that when you add, delete or change a service file you need to reload (sudo systemctl daemon-reload). Then when it is right, sudo systemctl enable <service file name> to allow it to run automatically.
 
  


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
Gateway/iptables help! basil_brush Slackware 1 10-14-2012 06:09 PM
IPtables and a Frox gateway Scormen Linux - Server 0 03-27-2009 03:38 PM
Iptables on gateway rcm_b05 Linux - Networking 2 11-16-2007 11:18 PM
Linux gateway with iptables - Everybody help me, please b:z Linux - Security 1 03-30-2005 06:58 PM
iptables rules on gateway alon005 Linux - Security 7 10-05-2004 07:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration