Forums

Resolved
0 votes
I'm trying to isolate LAN segments, but I can't seem to get the iptables rules to work the way the ClearOS example says they should.

Two NICS providing LAN segments should be segregated, as one is for management, the other is for users.


Please see attachment for input and results.
1 snippet straight from ClearOS docs. I believe I'm duplicating this correctly.
2 the NICs in question, as seen in webconfig GUI
3 the commands entered in CLI
4 the resulting output from "iptables -L -n -v --line-numbers"
5 the ping still going through
Attachments:
Tuesday, September 14 2021, 02:57 PM
Share this post:

Accepted Answer

Tuesday, September 14 2021, 04:32 PM - #Permalink
Resolved
0 votes
The rules look OK but not the testing. The INPUT chain is used for blocking traffic into the server and the FORWARD chain for blocking traffic through the server. Try your ping test to a LAN device rather than the LAN interface, but note it is better to avoid a Windows machine as a ping target as they generally block pings from outside your own subnet. If you have a printer or something like that, try pinging it.

Note that if you want management to be able to access the user LAN, only one rule should be used to block traffic from the user LAN (-i) to the management LAN (-o), and add the following to your rule:
-m conntrack --ctstate NEW
Then replies back to the management should still get through.
The reply is currently minimized Show
Responses (4)
  • Accepted Answer

    Wednesday, September 15 2021, 08:03 PM - #Permalink
    Resolved
    0 votes
    Thank you Nick,

    That got me sorted with improved functionality.
    Maybe I'll poke it again some day for internal DNS function between the two branches.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 15 2021, 08:25 PM - #Permalink
    Resolved
    0 votes
    If you want ClearOS to resolve an FQDN to a different IP dependent on your LAN, either add a line to /etc/dnsmasq.conf:
    localise-queries
    Or create a file in /etc/dnsmasq.d/ and put the same line in it. dnsmasq will then hand out an IP from /etc/hosts specific to an interface where possible, if one exists. If only one line exists for that FQDN, it will hand out the same IP to all interfaces.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 15 2021, 09:08 PM - #Permalink
    Resolved
    0 votes
    The relevant entries/targets would be servers on the user branch in a windows subdomain. Clear doesn't handle dns for the windows domain, so I suspect this approach won't work. Not sure how to approach it, or if it's even worth it.

    Maybe windows DNS can do it all with lookup zones. I'll have to read.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, September 16 2021, 07:38 AM - #Permalink
    Resolved
    0 votes
    You can either make your DC ClearOS's upstream resolver or you can go for split horizon in Dnsmasq. For split horizon, again, add a file in /etc/dnsmasq.d/ and in it put something like:
    server=/your_domain/your_DC_IP
    Have a look at "man dnsmasq" for more information. Just be careful that you do not set up a DNS loop, e.g. if you make the DC ClearOS's upstream resolver, the DC then has to use something other than ClearOS as its upstream resolver.
    The reply is currently minimized Show
Your Reply