LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 04-12-2018, 01:05 PM   #1
mnauta
Member
 
Registered: Apr 2003
Posts: 152

Rep: Reputation: Disabled
CentOS 7 router setup problem


Hi,

I have windows box IP 10.1.10.2 on switch2 (LAN) and CentOS router IP 192.168.1.142 and 10.1.10.1 on switch1 (WAN) and switch2 (LAN). Switch 1 is connected to the WAN whose default gateway is 192.168.1.1

All boxes can ping each other fine. The router can ping the WAN gateway and ping the Windows box on the LAN. The Windows box can ping the router at 10.1.10.1 and the centos7 router can ping google.com

However, I can't get to the internet from the windows box.


I did the following steps on the centos7 router, where I am I going wrong with this?

Quote:
systemctl disable firewalld

vi /etc/sysctl.d/ip_forward.conf

and added: net.ipv4.ip_forward = 1

sysctl -p /etc/sysctl.d/ip_forward.conf

systemctl restart network

———

[root@localhost network-scripts]# more ifcfg-ens192
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
ONBOOT="yes"
IPADDR="10.1.10.1"
NETMASK="255.0.0.0"
DNS1="8.8.8.8"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens192"
UUID="218aa40e-d706-42a9-b77c-c7313f392b09"
DEVICE="ens192"

———

[root@localhost network-scripts]# more ifcfg-ens224
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.1.142
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DNS1=8.8.8.8
ZONE=external
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens224
UUID=d38d7147-45a1-4a59-8c2a-6df3d24362e1
DEVICE=ens224
ONBOOT=yes
[root@localhost network-scripts]#

———

[root@localhost network-scripts]# ip route
default via 192.168.1.1 dev ens224 proto static metric 100
10.0.0.0/8 dev ens192 proto kernel scope link src 10.1.10.1 metric 100
192.168.1.0/24 dev ens224 proto kernel scope link src 192.168.1.142 metric 100
 
Old 04-12-2018, 08:25 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
Did you enable forwarding (wondering outloud??) https://rhel7tutorial.wordpress.com/...ip-forwarding/
 
Old 04-12-2018, 08:37 PM   #3
mnauta
Member
 
Registered: Apr 2003
Posts: 152

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Did you enable forwarding (wondering outloud??) https://rhel7tutorial.wordpress.com/...ip-forwarding/
Yes, did that right away - see line 2,3 and 4 in my above listed steps I did.
 
Old 04-12-2018, 10:17 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,784

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
What do your firewall rules look like? (No, don't post that. The iptables rules that firewalld generates are not meant for human comprehension.) I see you disabled firewalld, which prevents it from starting automatically but doesn't affect the current session. At a minimum you need a firewall rule in the "nat" table to masquerade forwarded traffic so that the packets will use your public IP address as their source address. Without that, responses cannot be routed back to you.

You should either configure firewalld to do what you need, or else stop and mask it entirely ("systemctl mask ..." means block the unit from being started by any means, automatic or manual) and generate your own ruleset from scratch. (And BTW, stopping the firewalld service does not flush whatever iptables rules are currently in effect.) Unless you're an expert, it's going to be a lot easier just to configure firewalld (Applications -> Sundry -> Firewall). See Configuring Firewalld.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help on setup of fedora 20 as a router from nic setup to firewalld setup Brian1 Linux - Networking 4 07-02-2014 08:53 PM
centos as router problem amr.es Linux - Networking 4 02-22-2014 07:09 AM
[SOLVED] CentOS 5.8 NAT router icmp unreachable admin prohibited problem kenneth_phough Linux - Networking 6 08-09-2012 08:14 AM
CentOS VLANs and Cisco Catalyst switch (router on stick problem) Grejeru Linux - Networking 4 07-28-2011 02:08 PM
Router setup on redhat linux 9.0 problem thirumala Linux - Networking 0 03-24-2004 01:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

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