LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-17-2010, 02:00 AM   #1
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Rep: Reputation: 0
Port farwarding


In my lan i have installed squid server in mandriva 2009 its working fine but i have a ip cam for video recording at remote site of a online exam . i have alloted ip address for this cam .now i need port farwarding for that ip at 10001 port in mandriva 2009. i have done it at router but i want to do it in my linux server
 
Old 05-17-2010, 02:55 AM   #2
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
You need to give us more detail. Network interfaces, and IP addresses of everything relevant would be a start.
 
Old 05-17-2010, 03:14 AM   #3
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SuperJediWombat! View Post
You need to give us more detail. Network interfaces, and IP addresses of everything relevant would be a start.
My lan subnet is 192.168.0.0 , squid proxy server ip address is 192.168.0.1 and the ip of ip cam is 192.168.0.200. i want to port farwarding for this ip .

Last edited by MEETKAMBOJ; 05-18-2010 at 03:42 AM.
 
Old 05-17-2010, 06:38 AM   #4
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Is the squid proxy acting as a NAT router? Where should the port be forwarded from? Are you trying to connect to the IP Camera from the internet? We still need more information.

Run these commands from the Squid server and post the output to us:
Code:
ifconfig
ip route
iptables-save
 
Old 05-17-2010, 11:57 PM   #5
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SuperJediWombat! View Post
Is the squid proxy acting as a NAT router? Where should the port be forwarded from? Are you trying to connect to the IP Camera from the internet? We still need more information.

Run these commands from the Squid server and post the output to us:
Code:
ifconfig
ip route
iptables-save
squid proxy work as nat router.
i want to connect ip cam with internet . it will be used as virtual host. my lan information is:-
ifconfig :
eth0 Link encap:Ethernet HWaddr 00:E0:4C:39:40:A5
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:4cff:fe39:40a5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3991 errors:0 dropped:0 overruns:0 frame:0
TX packets:5757 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:582097 (568.4 KiB) TX bytes:6029704 (5.7 MiB)
Interrupt:17 Base address:0x2c00

eth1 Link encap:Ethernet HWaddr 00:1F:C6:27:439
inet addr:202.131.116.116 Bcast:202.131.116.119 Mask:255.255.255.248
inet6 addr: fe80::21f:c6ff:fe27:43d9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10980 errors:0 dropped:0 overruns:0 frame:0
TX packets:11532 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:7897350 (7.5 MiB) TX bytes:1479927 (1.4 MiB)
Memory:fe940000-fe960000

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:86 errors:0 dropped:0 overruns:0 frame:0
TX packets:86 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5630 (5.4 KiB) TX bytes:5630 (5.4 KiB)

[root@localhost aaa]# ip route
202.131.116.112/29 dev eth1 proto kernel scope link src 202.131.116.116 metric 5
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1 metric 10
169.254.0.0/16 dev eth1 scope link metric 5
169.254.0.0/16 dev eth0 scope link metric 10
default via 202.131.116.113 dev eth1 metric 5

Last edited by MEETKAMBOJ; 05-18-2010 at 03:49 AM.
 
Old 05-18-2010, 03:45 AM   #6
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Quote:
Originally Posted by SuperJediWombat! View Post
Code:
iptables-save
We need that too.

Last edited by SuperJediWombat!; 05-18-2010 at 03:46 AM.
 
Old 05-18-2010, 05:48 AM   #7
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SuperJediWombat! View Post
We need that too.

after iptables-save command i did not get any out put
 
Old 05-18-2010, 07:15 AM   #8
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
If the default gateway of your IP camera is set to 202.131.116.116 then this rule will do the job:
Code:
iptables -t nat -A PREROUTING -d 202.131.116.116 -p tcp --dport 10001 -j DNAT --to-destination 192.168.0.200:10001
If no default gateway is set on the camera you need this too:
Code:
iptables -t nat -A POSTROUTING -d 192.168.0.200 -p tcp --dport 10001 -j SNAT --to-source 192.168.0.1

Last edited by SuperJediWombat!; 05-18-2010 at 08:10 AM.
 
Old 05-18-2010, 08:13 AM   #9
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Oh, you also need to enable IP forwarding, if you haven't already.

Check if you have by running
Code:
cat /proc/sys/net/ipv4/ip_forward
If the output of that command is "0" run this:
Code:
 echo 1 > /proc/sys/net/ipv4/ip_forward
 
Old 05-20-2010, 12:00 AM   #10
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SuperJediWombat! View Post
Oh, you also need to enable IP forwarding, if you haven't already.

Check if you have by running
Code:
cat /proc/sys/net/ipv4/ip_forward
If the output of that command is "0" run this:
Code:
 echo 1 > /proc/sys/net/ipv4/ip_forward

my ip cam gateway is 192.168.0.1. plz give me code according this.
 
Old 05-20-2010, 07:27 PM   #11
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
I just did.
 
1 members found this post helpful.
Old 05-31-2010, 05:37 AM   #12
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
[QUOTE=SuperJediWombat!;3975999]I just did.[/Q
Thanks sir
You are great in linux
 
Old 05-31-2010, 09:13 AM   #13
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
No problem, I'm glad that it worked.

- SuperJediWombat
 
Old 06-01-2010, 10:53 PM   #14
MEETKAMBOJ
Member
 
Registered: May 2010
Posts: 41

Original Poster
Rep: Reputation: 0
I have one question again.

in my windows xp network i have installed mandriva 2009 and implimenting squid proxy server. my local xp computer accessing internet fine but iwant to allow outlook express and yahoo messnager. how can i do this
 
Old 06-02-2010, 09:21 AM   #15
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
Google this:
iptables masquerade
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: LD Port Report Project aka Switch Port Mapper Tool LXer Syndicated Linux News 0 05-10-2009 07:11 PM
Configuring Automatic Redirects from port 80 to port 443 with bundled Apache server kaplan71 Fedora 1 12-28-2007 08:30 AM
Port Farwarding issue. Tux_Phoenix Linux - Networking 3 03-23-2006 03:35 AM
XMMS fast farwarding randomly - Solution kaega2 Linux - Software 1 08-11-2004 10:39 PM
--destination-ports port[,port[,port...]] KevinGuy Linux - Networking 1 03-16-2004 06:06 PM

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

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