LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-19-2007, 08:06 PM   #1
flycast
Member
 
Registered: Jul 2006
Posts: 89

Rep: Reputation: 15
Problems setting up two NIC's - Slackware 11.0


I am trying to set up two NIC's in Slackware. My rc.inet1.conf looks like this:
Quote:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_IPADDR[0]="192.168.1.150"
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]=""
NETMASK[1]=""
USE_DHCP[1]="yes"
DHCP_IPADDR[1]="192.168.1.151"
DHCP_HOSTNAME[1]=""
When I try to restart:
Quote:
root@slacker:~# /etc/rc.d/rc.inet1 restart
dhcpcd: MAC address = <removed>:50
dhcpcd: MAC address = <removed>:14
dhcpcd: your IP address = 192.168.1.151
root@slacker:~# ifconfig
eth1 Link encap:Ethernet HWaddr <removed>:50
inet addr:192.168.1.151 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:209 errors:0 dropped:0 overruns:1 frame:0
TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13497 (13.1 KiB) TX bytes:6764 (6.6 KiB)
Interrupt:3 Base address:0xdc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:609 (609.0 b) TX bytes:609 (609.0 b)
Logging from my rc.inet1 file when it is restarted
Quote:
Apr 19 19:15:04 localhost logger: /etc/rc.d/rc.inet1: /sbin/dhcpcd -k -d eth0
Apr 19 19:15:05 localhost logger: /etc/rc.d/rc.inet1: /sbin/dhcpcd -k -d eth1
Apr 19 19:15:06 localhost logger: /etc/rc.d/rc.inet1: /sbin/ifconfig lo down
Apr 19 19:15:06 localhost logger: /etc/rc.d/rc.inet1: /sbin/ifconfig lo 127.0.0.1
Apr 19 19:15:06 localhost logger: /etc/rc.d/rc.inet1: /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
Apr 19 19:15:06 localhost logger: /etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t 60 -s 192.168.1.150 eth0
Apr 19 19:15:09 localhost kernel: eth0: Setting full-duplex based on MII#1 link partner capability of 41e1.
Apr 19 19:16:06 localhost logger: /etc/rc.d/rc.inet1: /sbin/dhcpcd -d -t 60 -s 192.168.1.150 -s 192.168.1.151 eth1
Apr 19 19:16:06 localhost dhcpcd[2311]: infinite IP address lease time. Exiting
I am not a networking genius. I am trying to get both card up so I can move forward with allowing others on my network to connect through the linux box to a proxy server. Any ideas?

Last edited by flycast; 04-22-2007 at 11:59 AM.
 
Old 04-20-2007, 08:58 AM   #2
hubbruch
LQ Newbie
 
Registered: Apr 2007
Location: Europe
Distribution: Slackware
Posts: 14

Rep: Reputation: 0
Hiya,

question: are both NICs of the same brand/model? If not, are you sure that the drivers for your eth0 are fully functional?

If this is a tulip card, try googling some. Lots of ppl seem to have come across this problem.
 
Old 04-20-2007, 09:42 AM   #3
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
With the setup you describe, you are asking the cards to get their IP addresses from DHCP servers at IP address 192.168.1.150 and 192.168.1.151. I don't think this is what you are trying to achieve.

You probably want your Linux box to connect to the proxy server using an IP address assigned to the linux box by DHCP, so set the DHCP_IPADDR[0]=< your proxy IP address>.

You can have your network clients to connect to your linux box by assigning a static IP address to the other NIC, so set
IPADDR[1]="192.168.1.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_IPADDR[1]=""

# Default gateway IP address:
GATEWAY="192.168.1.1"

Then configure your network clients to use static IP addresses such as 192.168.1.2, 192.168.1.3, etc. Also set a default gateway of 192.168.1.1
 
Old 04-21-2007, 10:33 AM   #4
flycast
Member
 
Registered: Jul 2006
Posts: 89

Original Poster
Rep: Reputation: 15
It's a driver problem. I am working on that now. The two card s are different and the new one needs tulip module to operate. I am getting help elsewhere on this and will get back to this thread one I get it running. Thanks for the advice.
 
Old 04-22-2007, 12:11 PM   #5
flycast
Member
 
Registered: Jul 2006
Posts: 89

Original Poster
Rep: Reputation: 15
Ok, my goal is the following:
Have some PC's connect directly to the DSL router,
Have other PC's connect wirelessly through a proxy server on the LinuxBox that is running internet content filtering.

My layout looks like this:
I have a DSL connection to the internet. The DSL router assigns IP addresses dynamically.

There are three PC's that connect to that router: LinuxBox (wired through ETH0)
XP1 (wired)
XP2 (wireless)

I have a second Ethernet card (ETH1) in the LinuxBox that has a Linksys wired/wireless router.

I have two other machines (Mac and Wii) that have wireless capability but I am not allowing them to connect through the DSL connection because they lack filtering. I prevent their connections by their MAC addresses (and all other mac addresses) at the DLS router.

My proposed network looks like this:

Code:
              Internet
                 |
                 |
            DSL Router
                 |
                 |
    --------------------------------------
    |                |                   |
    |                |          (wired through ETH0)
XP1 (wired)    XP2 (Wireless)         LinuxBox
                                 (TinyProxy and DansGuardian)
                                         |
                                         |
			Eth1 card wired to Linksys router
                                         |
                                         |
                         ---------------------------------
                         |                               |
              Nintendo Wii (wireless)           Macintosh (wireless)
Now on to the LinuxBox configuration...
My rc.inet1.config looks like this:
Quote:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""

IPADDR[1]="192.168.1.150"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]="no"
DHCP_HOSTNAME[1]=""
My ifconfig results look like this (with loopback removed):
Code:
eth0      Link encap:Ethernet  HWaddr <removed>:14
          inet addr:192.168.1.151  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6018 errors:0 dropped:0 overruns:1 frame:0
          TX packets:1783 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:770762 (752.6 KiB)  TX bytes:193021 (188.4 KiB)
          Interrupt:9 Base address:0xdc00

eth1      Link encap:Ethernet  HWaddr <removed>:50
          inet addr:192.168.1.150  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:418 errors:0 dropped:0 overruns:0 frame:0
          TX packets:389 errors:8 dropped:0 overruns:0 carrier:8
          collisions:0 txqueuelen:1000
          RX bytes:246620 (240.8 KiB)  TX bytes:67957 (66.3 KiB)
          Interrupt:3 Base address:0xd800
And my iptables look like this:
Code:
 Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:3128 OWNER UID match 99
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 OWNER UID match 99
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 OWNER UID match 99
REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 redir ports 8080
REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:3128 redir ports 8080
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:3128 OWNER UID match 99
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 OWNER UID match 99
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 OWNER UID match 99
REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 redir ports 8080
REDIRECT   tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:3128 redir ports 8080
I suspect that I have some iptables rules to write but an not sure where to start. The iptables above are transparently redirecting any traffic (except traffic from user 99) that comes in for port 80 (http) to port 8080(DansGuardian). It's not shown here but DansGuardian connects to TinyProxy at port 3128. Also, there is a rule that keeps users from connecting directly to TinyProxy (3128) directly and redirects it to 8080 (DansGuardian).

I think that:
1) For some reason my rules are getting duplicated. I need to fix this.

2) These iptable rules are keeping me from connection to my router (IP unknown) connected to ETH1 (192.168.1.150). Do I need to add a rule to allow connection to the router?

3) I need to add some rule(s) that forwards connections received from the router (IP unknown) at ETH1 (192.168.1.150) to DansGuardian (port 8080).
 
  


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
Problems with setting up raid1 with mdadm on slackware kikola Slackware 0 08-21-2006 05:29 AM
Problems setting up network with slackware 10 Cocheese1080 Linux - Newbie 1 04-01-2006 10:11 PM
Require assistance setting up PPPoe with firewall (2 NIC's) roggs Linux - Networking 3 12-09-2004 12:48 PM
What wireless nic's are compadible with Slackware 9.1? mgame2k Linux - Hardware 1 02-08-2004 05:50 PM
Problem setting up two NIC's Ryan_Sutton Linux - Networking 1 05-29-2002 07:43 AM

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

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