Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: web-server act like router

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default web-server act like router

    i have local web-server joomla runs on it


    ||web-server 192.168.100.1|| ----- clients i wants to do that if my clients have a different ip like if someone has 192.168.1.25/24 he also access webserver local host on 192.168.100.1

    is my web-server act like router ?

  2. #2
    Senior Member Rahul.Patil's Avatar
    Join Date
    Feb 2012
    Location
    Mumbai india
    Posts
    486
    Thanks
    10
    Thanked 50 Times in 47 Posts
    Rep Power
    8

    Default

    Quote Originally Posted by thetigerzzz View Post
    is my web-server act like router ?
    You can check ip forwerding is enabled or not using below command
    Code:
    sysctl -a | grep -i net.ipv4.ip_forward
    net.ipv4.ip_forward = 0
    Note :- if output "net.ipv4.ip_forward = 1" means ip forwerding enabled and client can access your web server.

    Your Query is not Clear to us , can you elaborate more ? what you want to achieve ?
    Rahul Patil <http://www.linuxian.com>

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default web-server act like router

    Quote Originally Posted by Rahul.Patil View Post
    You can check ip forwerding is enabled or not using below command
    Code:
    sysctl -a | grep -i net.ipv4.ip_forward
    net.ipv4.ip_forward = 0
    Note :- if output "net.ipv4.ip_forward = 1" means ip forwerding enabled and client can access your web server.

    Your Query is not Clear to us , can you elaborate more ? what you want to achieve ?
    thanks for reply

    bro i want to achieve that i have local hosted web server serving data for local clients on LAN web server ip is
    192.168.100.1/24 if user give wrong ip to there LAN for example 192.168.2.1 or 10.0.0.1 etc and then try to open 192.168.100.1 website appears on there browsers

    is my linux machine act like Cisco router ?

  4. #4
    Senior Member Rahul.Patil's Avatar
    Join Date
    Feb 2012
    Location
    Mumbai india
    Posts
    486
    Thanks
    10
    Thanked 50 Times in 47 Posts
    Rep Power
    8

    Default

    Quote Originally Posted by thetigerzzz View Post
    thanks for reply

    bro i want to achieve that i have local hosted web server serving data for local clients on LAN web server ip is
    192.168.100.1/24 if user give wrong ip to there LAN for example 192.168.2.1 or 10.0.0.1 etc and then try to open 192.168.100.1 website appears on there browsers

    is my linux machine act like Cisco router ?
    to act as router you have to enable ip forwarding in your 192.168.100.1 box and set this ip as gateway in client side

    OR

    You can try this, just add Virtual IP (alias) using :
    Code:
    ifconfig eth0:0 192.168.2.200 netmask 255.255.255.0
    ifconfig eth0:1 10.0.0.200 netmask 255.0.0.0
    Note :- above ip's just an example , you have to specify ip which is free in your network.
    then try to ping or access your website from 192.168.2.1 or 10.0.0.1, and then let me know if this work.

    Some links for the same
    Linux Advanced Routing & Traffic Control HOWTO
    Linux Advanced Routing & Traffic Control HOWTO
    http://jukie.net/~bart/multicast/Lin...MiniHOWTO.html
    Last edited by Rahul.Patil; 19th November 2012 at 04:10 PM.
    Rahul Patil <http://www.linuxian.com>

  5. #5
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default web-server act like router

    Quote Originally Posted by Rahul.Patil View Post
    to act as router you have to enable ip forwarding in your 192.168.100.1 box and set this ip as gateway in client side

    OR

    You can try this, just add Virtual IP (alias) using :
    Code:
    ifconfig eth0:0 192.168.2.200 netmask 255.255.255.0
    ifconfig eth0:1 10.0.0.200 netmask 255.0.0.0

    thanks for reply
    bro i done this ping is working but website is not accessible from 192.168.100.1 and i also enable ip forwarding but this is not my gateway if i add this gateway on client side my internet is not working :P

  6. #6
    Senior Member Rahul.Patil's Avatar
    Join Date
    Feb 2012
    Location
    Mumbai india
    Posts
    486
    Thanks
    10
    Thanked 50 Times in 47 Posts
    Rep Power
    8

    Default

    Quote Originally Posted by thetigerzzz View Post
    thanks for reply
    bro i done this ping is working but website is not accessible from 192.168.100.1 and i also enable ip forwarding but this is not my gateway if i add this gateway on client side my internet is not working :P
    to work internet, we have to enable masquerading in your linux box , access this page for the same
    Rahul Patil <http://www.linuxian.com>

  7. #7
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default web-server act like router

    Quote Originally Posted by Rahul.Patil View Post
    to work internet, we have to enable masquerading in your Linux box
    this is only a web server / ftp serving a data to 200 users not a gateway machine problem is that some time users give wrong ip to network card cant access web-server /ftp /

  8. #8
    Senior Member Rahul.Patil's Avatar
    Join Date
    Feb 2012
    Location
    Mumbai india
    Posts
    486
    Thanks
    10
    Thanked 50 Times in 47 Posts
    Rep Power
    8

    Default

    Quote Originally Posted by thetigerzzz View Post
    thanks for reply
    bro i done this ping is working but website is not accessible from 192.168.100.1 and i also enable ip forwarding but this is not my gateway if i add this gateway on client side my internet is not working :P
    if they able to ping , then they can access 80 and 21 port , so you just need to make sure, iptables and SELinux is enabled in that server , disable temporary to checking the same. also let us know what error you are getting in client side. also you can check using "telnet webserverip 80" to check port 80 is opened or not .
    Rahul Patil <http://www.linuxian.com>

  9. #9
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default web-server act like router

    Quote Originally Posted by Rahul.Patil View Post
    if they able to ping , then they can access 80 and 21 port , so you just need to make sure, iptables and SELinux is enabled in that server , disable temporary to checking the same. also let us know what error you are getting in client side. also you can check using "telnet webserverip 80" to check port 80 is opened or not .
    Dear bro i test it SELinux disabled. iptables -F , ip forwarding enable eth0 ip : 192.168.200.1/24 eth0:1 ip 192.192.168.10.1/24

    user client side ip is 192.168.10.5/24 only ping is working on 192.168.200.1 with 29 ms delay no ssh ( only ssh and websites is working if i will open website with 192.168.10.1

  10. #10
    Senior Member Rahul.Patil's Avatar
    Join Date
    Feb 2012
    Location
    Mumbai india
    Posts
    486
    Thanks
    10
    Thanked 50 Times in 47 Posts
    Rep Power
    8

    Default

    Quote Originally Posted by thetigerzzz View Post
    Dear bro i test it SELinux disabled. iptables -F , ip forwarding enable eth0 ip : 192.168.200.1/24 eth0:1 ip 192.192.168.10.1/24

    user client side ip is 192.168.10.5/24 only ping is working on 192.168.200.1 with 29 ms delay no ssh ( only ssh and websites is working if i will open website with 192.168.10.1
    What error you are getting on browser ?
    did you tried telnet webserver 80 ?
    any errors in webserver logs ?
    Rahul Patil <http://www.linuxian.com>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. router between two linux PC
    By nany in forum Linux software
    Replies: 0
    Last Post: 18th June 2011, 08:35 PM
  2. 1 Router - 3 Networks - Big Help
    By phatlix in forum Networking, Firewalls and Security
    Replies: 0
    Last Post: 6th September 2007, 03:26 PM
  3. Need Help--Netopia r910 router
    By zafar466 in forum Networking, Firewalls and Security
    Replies: 0
    Last Post: 2nd August 2007, 12:07 AM
  4. hacking into router
    By raj1 in forum Linux software
    Replies: 1
    Last Post: 11th January 2006, 11:41 PM
  5. airtel router setup
    By rudra in forum Linux software
    Replies: 0
    Last Post: 8th January 2006, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •