Operating System - Linux
1832864 Members
2840 Online
110048 Solutions
New Discussion

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

 
SOLVED
Go to solution
debian111
Regular Advisor

NAT works, when i change machine firewall connects to, nat stops working!!!

Hi ,
I made nat on compA ( two network interfaces )

compA-----------crossover cable------------------compB

on compB I have not any firewall, compB has ip address 192.168.1.10
Internal interface on compA has ip address 192.168.1.1--gateway for compB. I can go to internet from compB in this environment.
When I change RJ-45 jack from compB to another machine compC ( compC has the same configuration as compB previously) I can not surf any more.
OS is debian on all machines. I just switch on to other machine.
I tried to change ip address on compC ( for example 192.168.1.20 ) and I have the same situation.
I did not make any changes on compA. I did not even touch it )

So is there any solution for this problem ?
Any comment is welcome.

Thanks in advance
6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

You should ensure that compC can connect to compA. Verify if ping works or another kind of connection, like ssh.

Ensure that compC have the default gateway also configured and DNS servers configured.

From computerC, post the output of:

ifconfig -a
netstat -nr
ping compA
dig www.hp.com
traceroute www.hp.com
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
debian111
Regular Advisor

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

data are from compC

ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:30:05:0D:DB:B4
inet addr:192.168.1.10 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::230:5ff:fe0d:dbb4/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:267 errors:0 dropped:0 overruns:0 frame:0
TX packets:180 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25476 (24.8 KiB) TX bytes:21730 (21.2 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2788 errors:0 dropped:0 overruns:0 frame:0
TX packets:2788 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3092212 (2.9 MiB) TX bytes:3092212 (2.9 MiB)

sit0 Link encap:IPv6-in-IPv4
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)


netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0


ping 192.168.1.1 ( compA )
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=0.219 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.241 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.263 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.242 ms


dig www.hp.com

; <<>> DiG 9.2.4 <<>> www.hp.com
;; global options: printcmd
;; connection timed out; no servers could be reached

traceroute www.hp.com
traceroute: unknown host www.hp.com

It is possible ping copmC from compA

ping 192.168.1.10
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.277 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.198 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=0.231 ms


thanks

Ivan Ferreira
Honored Contributor
Solution

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

From the output of the commands:

dig www.hp.com

; <<>> DiG 9.2.4 <<>> www.hp.com
;; global options: printcmd
;; connection timed out; no servers could be reached

traceroute www.hp.com
traceroute: unknown host www.hp.com


It's possible to know that your DNS configuration is incorrect. You cannot resolve host names. Compare the /etc/resolv.conf files on compB and compC. The file should look like:

domain yourdomain.com
nameserver ip.of.dns.server
nameserver ip.of.another.dns
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
George Liu_4
Trusted Contributor

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

restart firewall on compA. Could it use MAC instead of IP in firewall?
Also check the firewall service on compC. Disabled it if it is on
debian111
Regular Advisor

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

That is correct, with your help I solved id

Thank you
debian111
Regular Advisor

Re: NAT works, when i change machine firewall connects to, nat stops working!!!

Thanks everyone.

Regards