LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2017, 04:24 AM   #1
willy70
LQ Newbie
 
Registered: May 2017
Posts: 3

Rep: Reputation: Disabled
[SOLVED]IP Forwarding strange problem ....


Dear All,
I'm newbie in RH7 Networking but I'd like to use it to make a new server with one Nic and some vlan to route traffic from private to public.

This is the scenario:

ETH0: 10.0.199.199 / 16
ETH0.2: 10.2.0.251 / 16
ETH0.101: 1.1.1.1 / 24 (public)
GATEWAY 1.1.1.254

all of them are in /etc/sysconfig/network-scripts/ifcfg-XXXX and also in /etc/sysconfig/network is FORWARDING=YES

Before start I read some guide and I've made this settings:

net.ipv4.ip_forwarding = 1
all iptables chains flush and set to ACCEPT (only for debug purpose) , also set masquearding to nat traffic from private to public
iptables -t nat -A POSTROUTING -s 10.0.0.0/255.0.0.0 ! -d 10.0.0.0/255.0.0.0 -o eth0.101 -j SNAT --to-source 1.1.1.1

Firewalld is stopped because I don't want use it.

After that I've used ping to make test:

[root@centos-7 ~]# ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.0.199.199 eth0: 56(84) bytes of data.
From 10.0.0.9 icmp_seq=1 Packet filtered
From 10.0.0.9 icmp_seq=2 Packet filtered

but as you can see it doesn't work !

Any ideas ?

Thanks a lot.
Regards
Willy

Last edited by willy70; 05-31-2017 at 08:13 AM.
 
Old 05-18-2017, 05:00 AM   #2
camp0
Member
 
Registered: Dec 2016
Location: Dublin
Distribution: Fedora
Posts: 70

Rep: Reputation: 4
The message "Packet Filtered" is from the iptables


http://tomoyo.osdn.jp/cgi-bin/lxr/so...r/ipt_REJECT.c

Also if you tcpdump the interface you could verify if the message is filtered by who
 
Old 05-18-2017, 05:28 AM   #3
willy70
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
if you have more time ...

[root@centos-7 ~]# netstat -r -n
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 1.1.1.254 0.0.0.0 UG 0 0 0 eth0.101
10.0.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.2.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0.2
1.1.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.101


[root@centos-7 ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

[root@centos-7 ~]# iptables -L -t nat
Chain PREROUTING (policy ACCEPT)
target prot opt source destination

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 10.0.0.0/8 !10.0.0.0/8 to:1.1.1.1

wth tcpdump I don't see anything:

[root@centos-7 ~]# tcpdump -i eth0.101 -e icmp[icmptype] == 8
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0.101, link-type EN10MB (Ethernet), capture size 65535 bytes


many thanks again.
Regards
W.

Last edited by willy70; 05-18-2017 at 05:29 AM.
 
Old 05-18-2017, 12:33 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Couple of questions:

1. Is the port that the cables coming out of eth0 plugged into a trunk port?
Only a trunk port can carry multiple vlans.

2. Are you going to allow traffic from one network to cross over to another network through your system?
If not than FORWARDing isn't required. Forwarding allows you to cross from one network to another turning your system into a router.
 
Old 05-31-2017, 08:12 AM   #5
willy70
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
the problem was inside nat because I've applied POSTROUTING to non existant interface !
Many thanks
Willy
 
  


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
strange X forwarding issue chris71mach1 Linux - Networking 5 09-03-2009 01:19 AM
Strange networking problem: connectivity lost when using x11 forwarding Selene Debian 2 10-06-2008 02:53 PM
strange, strange alsa problem: sound is grainy/pixellated? fenderman11111 Linux - Software 1 11-01-2004 06:16 PM
strange problem with either evolution or yahoo pop forwarding hobylinux Linux - Software 0 12-01-2003 11:16 AM
strange routing/IP forwarding behavior lukas_z Linux - Networking 3 07-25-2003 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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