LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-11-2014, 11:43 AM   #1
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Rep: Reputation: Disabled
Software to add HTML to webpages?


Hi, I'm trying to modify all webpages to add a small header. I have a computer set up with two network cards. One is on my internal network, the other is connected to my router. Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.
 
Old 01-11-2014, 05:22 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
how can you want something that is in and of its self by definition NAT. if you want to have multiple systems behind a router and you want ports forwarded to specific computers, that my friend is part of NAT.

you are asking several questions.

1.
Quote:
Hi, I'm trying to modify all webpages to add a small header.
for this you can use any editor like gedit, nano, piko, vi, etc... pick your poison so to speak.

2.
Quote:
I have a computer set up with two network cards. One is on my internal network, the other is connected to my router.
this is by definition NAT as your router will not, in most cases, pass your WAN side IP to the computer that it is connected to, it will pass a LAN side PRIVATE IP (192.xxx.xxx.xxx or 10.xxx.xxx.xxx or something along that line)

3.
Quote:
Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.
what you want is NAT combined with port forwarding. This is the power of NAT.
 
Old 01-11-2014, 05:34 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
I can't say I understand exactly what you are wanting to do. It appears you are running a webserver and you want to modify all your webpages that redirect things elsewhere? Is that it? If so, why don't you configure that in your webserver, not in the webpages themselves?
 
Old 01-11-2014, 05:38 PM   #4
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
No, I want to redirect all HTTP traffic at a proxy.
 
Old 01-12-2014, 05:14 AM   #5
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lleb View Post
how can you want something that is in and of its self by definition NAT. if you want to have multiple systems behind a router and you want ports forwarded to specific computers, that my friend is part of NAT.

you are asking several questions.

1. for this you can use any editor like gedit, nano, piko, vi, etc... pick your poison so to speak.

2.

this is by definition NAT as your router will not, in most cases, pass your WAN side IP to the computer that it is connected to, it will pass a LAN side PRIVATE IP (192.xxx.xxx.xxx or 10.xxx.xxx.xxx or something along that line)

3.

what you want is NAT combined with port forwarding. This is the power of NAT.


But having a double nat is bad...

Let's say my public IP is 1.2.3.4. The router has NAT built in, so I get a local ip (192.168.182.*) and then I want it to pass through my linux box into another subnet (still 192.168.182.*). I want to redirect all port 80 traffic to a proxy.
 
Old 01-12-2014, 11:50 AM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
double NAT is not bad and the two subnets you listed are the same.

sounds like you need to install an IPCop or IPFire real hardware firewall and configure the system for Red, Green, Orange then put up a 2nd firewall/router behind the Orange connection.

If you are just setting up a Proxy, you dont need a 2nd computer to do that just run it local on your Linux computer, but that will NOT mask your real world IP. For that you will require TOR or some 3rd party Proxy to pass all of your traffic through.

Also what I described is NOT double NAT. it is pure and simple NAT with port forwarding. its networking 101.
 
Old 01-12-2014, 12:47 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Hi, I'm trying to modify all webpages to add a small header.
if your CMS for the site is a php based cms there will be a header and footer php file
edit that

but that statement is so vague as the first person said
use gedit,kate,vi,nano,emacs,.....
 
Old 01-12-2014, 02:57 PM   #8
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
if your CMS for the site is a php based cms there will be a header and footer php file
edit that

but that statement is so vague as the first person said
use gedit,kate,vi,nano,emacs,.....
I'm trying to modify EVERY web page that comes through the wire.
 
Old 01-12-2014, 03:22 PM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
I'm trying to modify EVERY web page that comes through the wire.
that is a VERY different issue

the forum admins will need to chime in on if that topic is legal for us to post on this site

you could hack the version of firefox you are using ,then turn off user updates of firefox

it would be possible to get firefox to have something in the default window

but maintaining a CUSTOM build of firefox will be fun
other than that .....

Last edited by John VV; 01-12-2014 at 03:25 PM.
 
Old 01-12-2014, 04:41 PM   #10
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
that is a VERY different issue

the forum admins will need to chime in on if that topic is legal for us to post on this site

you could hack the version of firefox you are using ,then turn off user updates of firefox

it would be possible to get firefox to have something in the default window

but maintaining a CUSTOM build of firefox will be fun
other than that .....
What if I'm not using firefox? What if, on the other side of that wire, is a public network?
 
Old 01-12-2014, 06:04 PM   #11
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
to insert code into the headers of web sites on YOUR OWN LAN might be legal
as in YOU own all the computers that you are doing this to

but that is a double edged sword

something that crackers do .

so ....
 
Old 01-12-2014, 07:00 PM   #12
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by laptopdude90 View Post
Hi, I'm trying to modify all webpages to add a small header. I have a computer set up with two network cards. One is on my internal network, the other is connected to my router. Basically, I need something that forwards all connections to their usual destination except for port 80, which is redirected to a proxy. I want something without a NAT.
Are you talking about on-the-fly URL rewriting for requests coming in to your own webserver?

http://en.wikipedia.org/wiki/Rewrite_engine
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/rew...ite_guide.html
http://httpd.apache.org/docs/2.0/rew..._advanced.html

Or are you talking about a transparent proxy that sits between the client (on your LAN) and external internet webservers?

http://en.wikipedia.org/wiki/Proxy_s...nsparent_proxy

Last edited by Z038; 01-12-2014 at 07:03 PM.
 
Old 01-12-2014, 07:10 PM   #13
laptopdude90
LQ Newbie
 
Registered: Oct 2013
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Z038 View Post
Are you talking about on-the-fly URL rewriting for requests coming in to your own webserver?

http://en.wikipedia.org/wiki/Rewrite_engine
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
http://httpd.apache.org/docs/2.0/rew...ite_guide.html
http://httpd.apache.org/docs/2.0/rew..._advanced.html

Or are you talking about a transparent proxy that sits between the client (on your LAN) and external internet webservers?

http://en.wikipedia.org/wiki/Proxy_s...nsparent_proxy
The second one.
 
Old 01-12-2014, 07:34 PM   #14
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Oh, now I think I see what you're after (maybe, still not sure). If you want to do this modification on your web browser side, via a proxy setting in the web prowser, you should look at "Proximitron". That is a stellar piece of software, it hasn't had seen any new development for years, but will probably do what you need even though it's old. Google it. It's still out there for download.

Problem is, you'd have to run it under Wine or in a VM, since it's Windows software. I image that would be doable however.

Last edited by haertig; 01-12-2014 at 07:35 PM.
 
Old 01-12-2014, 10:48 PM   #15
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 910

Rep: Reputation: 174Reputation: 174
OK, here is a "how-to" for transparent proxying.

http://www.tldp.org/HOWTO/TransparentProxy.html

From the overview section:

Quote:
In ``ordinary'' proxying, the client specifies the hostname and port number of a proxy in his web browsing software. The browser then makes requests to the proxy, and the proxy forwards them to the origin servers. This is all fine and good, but sometimes one of several situations arise. Either

You want to force clients on your network to use the proxy, whether they want to or not.
You want clients to use a proxy, but don't want them to know they're being proxied.
You want clients to be proxied, but don't want to go to all the work of updating the settings in hundreds or thousands of web browsers.
and another:

http://wiki.squid-cache.org/SquidFaq/InterceptionProxy



.

Last edited by Z038; 01-12-2014 at 10:59 PM.
 
  


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
How to add a delay befor loading webpages? MaBu Linux - Software 11 03-04-2011 02:56 PM
Transmitting data across webpages (HTML and PHP question) resetreset Programming 3 09-19-2010 12:42 PM
squid performance slowing for html webpages qwertyjjj Linux - Newbie 8 02-11-2010 10:43 AM
Using mapping in VIM to add HTML? gaikokujinkyofusho Linux - Newbie 3 05-04-2009 11:57 PM
Converting HTML Webpages to PDF or JPEG with konqueror mrkirkland Linux - Software 2 01-31-2006 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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