How to Configure two NICs to set setup Squid proxy on RH linux 8.0
Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How to Configure two NICs to set setup Squid proxy on RH linux 8.0
I want to configure two NICs to setup Squid proxy on Red hat linux 8.0 machine. System detects two NICs 1)Compex's RL100-ATX 10/100 [winbond840] and 2) Dlink's RTL \8139 Ethernet [8139too]. How to set private and public IP addresses for them, so as to configure them for Squid Proxy. I tried but failed to 'ping' to Gateway's IP addr of 'My' Public IP Address. What changes I need to do in my squid.conf file.
Please help.
Your NIC's are configured by editing the files called /etc/sysconfig/network-scripts/ifcfg-eth0 (and eth1 and so forth). Fill in the info in each corresponding file for each nic, restart networking, and you should be set. Take it one step at a time. 1st get networking setup, then work on configuring the proxy.
I have already done it. But i could not reach to my Gateway (164.x.x.225). I am not able to reach it through 'ping'. What could be the problem? Ping to my eth0 and eth1 is successful. But can not go further.
Please help.
Thanks for your reply.
Due to medical reasons I could not get chance to act accordingly.
I fine now.
I entered the command: # route add....
But it replied command not found. Then i switched to sbin directory i run the coomand: #./rote add....
But it replied as:
SIOCADDRT:File exists.
Why this message?
Also I could not locate /etc/resolve.conf file. It is not present. Why? How to create this and what are its contents?
The file is called resolv.conf with no "e". It normally will give the message "file exists" after a route add default gw command, to tell you that it indeed does exist.
Found resolv.conf.
It contains the two entries for the nameserver-primary and secondary.
No. Cannot connect. (ping to gateway is unsuccessful).
What about proxy? Any modifications to squid.conf required?
I have added the tcp_outgoing_address to ip of ethx.
How to make sure gateway is accessible. It it 'ping' only ?
Thanks.
The key rule to remember is; if the linux box can connect, so can squid. First get the connection problems figured out, then squid setup will be a breeze.
Ping to gateway doesn't reply? Can you ping anything on that interface with a reply? If not edit the settings in the
/etc/sysconfig/ifcfg-ethx file (replace x with the corresponding number). What does that file look like?
These are my two files. I dont know whether both interfaces should gave the same gateway address or not.
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=210.212.185.165
NETMASK=255.255.255.0
GATEWAY=210.212.185.161
TYPE=Ethernet
USERCTL=no
PEERDNS=no
NETWORK=210.212.185.0
BROADCAST=210.212.185.255
HWADDR=00:80:48:d8:0b:f1
~
OK, first of all what do you want to do with 2 NIC?. I suppose that if you want to use squid is because your linux system is going to be a proxy server to other computers you have. On this way the first ethernet card is going to be connected to a modem or router and the second one to the others computers (through a hub or directly).
In this case, your ISP must give you some data, like if you have the same IP all times or your IP is going to be new assigned every time you connect (DHCP server). So first thing you have to do is to configure the first ethernet card with these data. You can do this executing "netcfg" in the shell. Then you can specify if it is going to be assigned by a DHCP server or you can specify your IP, your netmask and your gateway.
OK, before doing anything else, letīs go to confirm that your first ethernet card (eth0) is properly running, so execute "ifconfig" and you can see the right parameters that you have configured before. Then execute "ping xx.xx.xx.xx" where xx.... is the gateway IP.
The second card (eth1) must be configured in the same range of IPīs that your first card. This means that your netmask must allow you to reach the gateway. But before continuing, could you explian which is your idea of using two NIcīs and a proxy server?
Does it mean that only one NIC is sufficient for configuring linux box as a proxy server in a LAN.
Two LANs are connected via a hub. My present proxy server is in another LAN(another lab). I want my LAN connected thr' my proxy so that network traffic on the other proxy and LAN will be reduced/diverted. I got seperate public IP from ISP for the same. Can I use the same gateway that is used by current proxy?
You can probably get away with one NIC. Just set the gateway on the proxy and point the clients at the proxy machines ip address and it should work. I run the Privoxy proxy server on my laptop for the localhost and I just set mozilla to use localhost:8118 as its proxy.
Having two NICs allows you to prevent someone from going around the proxy by entering the gateway address.
Well, setting up of proxy is my next goal. At present I am unable to ping to my gatway ip and hence network connection for the same is not up. Ping to both interfaces is successful. Already I have given ifcfg-ethx files. Are they correct? Both interfaces should use same gateway ip or one of them is not
required gateway?
Make the settings for eth0 match the network settings of the gateway machine. Set the gateway for the gateway machines ip. Then give eth1 its own subnet, like 192.168.5.1, or whatever the existing network (with the clients) is using. If the gateway resides on the internal network (and you won't be connecting them directly) then simply set eth0 with settings matching the internal network, and of course set the gateway. You only need two nics if you are running two networks (LAN and one to connect to cable modem or ppp0 for dial-up modem).
The key rule to remember is; if the linux box can connect, so can squid. First get the connection problems figured out, then squid setup will be a breeze.
Ping to gateway doesn't reply? Can you ping anything on that interface with a reply? If not edit the settings in the
/etc/sysconfig/ifcfg-ethx file (replace x with the corresponding number). What does that file look like?
hELLO PCGHost
Happy New year
how r u ?? i am getting the same problem as said earlier in linuxas-4 .
i tried to search the file /etc/sysconfig/ifcfg-ethx . but i didn't find . is it avilable in Linux AS_4
please help me
thanks in advance
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.