LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-22-2006, 06:32 AM   #1
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Rep: Reputation: 0
Bridging Not Working ?


Hi there

A friend of mine helped me setup my linux box (me being a newbie) in order to share an ADSL internet connection over a small LAN. Everything is fine and dandy, only I don't have anymore room in my switch and I would like to connect with my Winbox directly to the server in order to make room for one more.
My linux server has FC3. Also installed in it is an onboard NIC (Intel [eth1]) and a separate Gbit NIC (Realtek [eth0]). The LAN is setup on the eth0 Gbit lan.
I would like to use my Winbox to access the internet through the server's onboard NIC.
My good friend who helped me do this whole setup said something about masquerading for my Win box's NIC.
He set everythig up but nothing seems to be working.
Also what I find weird is that for the eth0 NIC i have two IP's for it ?!?!?! Is that right ???
I went on a computer on my lan and in command prompt i did "arp -a" and it showed two ip's for one MAC
I remember my buddy set up an ip for the onboard nic and one ip for the Gbit NIC.
Whatever, thing is, how do I set up my linux box to give internet access to my Winbox through the onboard NIC ?
Please help.
 
Old 05-22-2006, 07:23 AM   #2
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
how were u sharing your connection previously? if you were using your fedora box as a network gateway, i think you should have been using ip masquerading. how is your network setup?
 
Old 05-22-2006, 08:19 AM   #3
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Previously I had used windows for my server box and everything was fine with ICS. But I had little to no control over how to limit my clients. And for my own box i could bridge the two internal NICs in my net box so i had internet too wothout pluggin into the switch.

All I want to know is a howto like tutorial to tell me how to enable internet access for my winbox through my linux FC3 server.
Thank you also for your prompt response.
 
Old 05-22-2006, 08:27 AM   #4
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Like i said in my first post, my LAN setup is like this :

Fedora 3 Box: 2 NICs
|...........................................|
eth0 (gbit realtek)__________ eth1 (onboard)
|...........................................|
8port Trendnet Switch______ Winbox
/|\
many users
(these guys have Internet)____I don't )

I still like to browse through Windows IE, just want to leave the linux box alone

Last edited by Sayon_6; 05-22-2006 at 08:33 AM.
 
Old 05-22-2006, 10:40 AM   #5
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Weird !!!!!

This is the weirdest thing ever:
This is what I get from ifconfig eth0 and eth1:
ifconfig eth0

eth0 Link encap:Ethernet HWaddr 00:80:1E:30:39:95
inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::280:1eff:fe30:3995/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:345632 errors:0 dropped:0 overruns:0 frame:0
TX packets:328693 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:94267685 (89.9 MiB) TX bytes:241312487 (230.1 MiB)
Interrupt:10 Base address:0x2000

[root@localhost ~]# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:50:8B:CE:B1:CE
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:8bff:fece:b1ce/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:280 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:12264 (11.9 KiB)

it is clearly that i have two NIC interfaces in my fedora sistem.
Now what is weird is when i log onto a Winbox from my LAN and type:
"arp -a" i see for my linux box TWO!!! ips set for one MAC !!!!
And when i ping anyone of the two ips from my winbox (the one i want to plug straight into the linux box) i get timed out response.
 
Old 05-23-2006, 02:04 AM   #6
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
you say you share your internet using fc3 box yet this boxen has no public ip on any of its interface. post your /etc/sysconfig/network-scripts/ifcfg-eth0 & eth1 along with your route output.
 
Old 05-23-2006, 06:15 AM   #7
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
This is my ip route:

ip route
86.35.77.254 dev ppp0 proto kernel scope link src 86.34.***.***
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.2
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
169.254.0.0/16 dev eth1 scope link
default via 86.35.77.254 dev ppp0


thing is i cannot run the command u gave me :

/etc/sysconfig/network-scripts/ifcfg-eth0 & eth1

it says :

-bash: /etc/sysconfig/network-scripts/ifcfg-eth0: Permission denied
-bash: eth1: command not found


i will use MC to dispaly the contents of what u asked though:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.0.2
USERCTL=no
PEERDNS=yes
GATEWAY=86.34.***.***
IPV6INIT=no

and this is for eth1:

DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
PEERDNS=yes
IPV6INIT=no
NETMASK=255.255.255.0
IPADDR=192.168.0.1
GATEWAY=86.34.***.***

this is what u asked for, can u give me some insight ?
 
Old 05-24-2006, 05:53 AM   #8
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
thing is i cannot run the command u gave me :

/etc/sysconfig/network-scripts/ifcfg-eth0 & eth1

it says :

-bash: /etc/sysconfig/network-scripts/ifcfg-eth0: Permission denied
-bash: eth1: command not found

i will use MC to dispaly the contents of what u asked though:
i asked for the same. and the 'route' command instead of 'ip route' would have given a more clear picture. anyways i think you need to add a route for you eth1 via ppp0. something like
route add -net 192.168.0.1 netmask 255.255.255.0 gw xxx.xxx.xxx.xxx dev eth1


also read this for more help:
http://gentoo-wiki.com/HOWTO_setup_a...server#Network

Last edited by prozac; 05-24-2006 at 05:55 AM.
 
Old 05-24-2006, 06:55 AM   #9
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
No Itrerupt ?

I just reinstalled FC3 again and set everything else. (it started acting weird )

this is the route command display:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
86.35.77.254 * 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
default 86.35.77.254 0.0.0.0 UG 0 0 0 ppp0

The thing is , I get an irq 10 display on eth0 wich seems to work fine, but teh weird thing that bothers me is that i get no irq display on eth1 when i go with the ifconfig ethx command. But it still brings up the interface... which is at least to say weird. I can see the LEDs blinking on the nic so i get the link too but i cannot ping the nic from my winbox and either from the linux box i can't ping the winbox. I KNOW THEY ARE WORKING BOTH!!! They do fine in windows.
 
Old 05-24-2006, 07:51 AM   #10
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
listen sayon i can't solve your problem like this but what i can do is tell you how things are done for internet sharing okay. hopefully some one better than me will show up and help you solve your problem.

first you check whether your network adapters are properly installed and detected: use the command
Code:
mii-tool
to see the nic's status;
eg o/p: eth0: negotiated 100baseTx-FD, link ok

next you set correct network addresses to all your network adapters:
ppp0: your isp provided ip address, gw and dns settings
eth0: a ip and netmask from the private ip range such as 192.168.0.1, use the
Code:
'setup' or 'netconfig'
command to do this or you can straight edit /etc/sysconfig/network-scripts/ifcfg-eth0 file.

next setup ip masquerading through your firewall(/etc/rc.d/rc.firewall):
Code:
       ## Load neccessary modules
        /sbin/modprobe iptable_nat
        /sbin/modprobe ipt_MASQUERADE

        ## Flush all existing rules
        /sbin/iptables -F
        /sbin/iptables -t nat -F
        /sbin/iptables -t mangle -F
        /sbin/iptables -X

        ## Accept all thats related and already established
        /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
        /sbin/iptables -A INPUT -m state --state NEW -i ! ppp0 -j ACCEPT
        # only if both of the above rules succeed, use
        #/sbin/iptables -P INPUT DROP

        /sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
        /sbin/iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT

        # use this line if you have a static IP address from your ISP
        # replace x.x.x.x with your static ip
        /sbin/iptables -t nat -A POSTROUTING -o ppp0 -j SNAT --to x.x.x.x

        # use this line only if you have dynamic IP address from your ISP
        #/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

        /sbin/iptables -A FORWARD -i eth0 -o eth0 -j REJECT
Code:
chmod 755 /etc/rc.d/rc.firewall
/etc/rc.d/rc.firewall
next you will need to add a route
Code:
route add -net 192.168.0.0 netmask 255.255.255.0 gw x.x.x.x dev eth0
configure all your other workstations to use the following set of ip's
Quote:
static IP address : 192.168.0.3 to 192.168.0.254
subnet Mask : 255.255.255.0
Default gateway : 192.168.0.1
Primary DNS Server : the same as in ppp0
Secondary DNS Server: the same as in ppp0

i think that sums it up. see if you can setup your network on your own.
 
Old 05-24-2006, 08:51 AM   #11
Sayon_6
LQ Newbie
 
Registered: May 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Will Try !!!

Thank you so much for your help, will try what u suggested and will give feedback ASAP.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
eathernet bridging??? brianmay27 Linux - Networking 1 05-18-2006 01:09 PM
WAG54G and Bridging cherif Linux - Networking 5 08-30-2005 07:07 AM
wireless bridging Damon Spector Linux - Wireless Networking 2 03-24-2005 09:12 PM
ethernet bridging not working twsnnva Linux - Networking 2 01-27-2005 03:49 PM
Bridging? JapaneseKamikaz Linux - Networking 0 03-11-2003 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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