Jump to content

Wireless and Ethernet (routing) error


Guest beomuex
 Share

Recommended Posts

Guest beomuex

Hi guys..

i've got a very basic problem:i want to share the wireless connection of my atheros-chip-card (Mandriva 2007) with the other Pcs in my network.But as i' finish the ddrakk of the ethernet connection i can't browse and ping to any homepages in the www?!

So at every startup i've got to type in:

ip route del default via 192.168.0.1 dev eth0 metric 10

>>>>So how do i make this permanment???

 

The other thing:

How can i share the connection?(without dhcp)

The command "traceroute" only reaches the pc1>the pc which should route to the accesspoint<

btw here a short overview about how it should work: PC1(10.0.0.2)>--------<PC2(10.0.0.1)eth0+ath0(dhcp>...............<Accesspoint(192.168.2.1)>------------------------------WWW

So here are some commands:

 

ip route:

[root@Resheph beowulf]# ip route

192.168.2.0/24 dev ath0 proto kernel scope link src 192.168.2.103 metric 35

192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1 metric 10

169.254.0.0/16 dev eth0 scope link metric 10

169.254.0.0/16 dev ath0 scope link metric 35

default via 192.168.2.1 dev ath0 metric 35

 

route -n

[root@Resheph beowulf]# route -n

Kernel IP Routentabelle

Ziel Router Genmask Flags Metric Ref Use Iface

192.168.2.0 0.0.0.0 255.255.255.0 U 35 0 0 ath0

192.168.0.0 0.0.0.0 255.255.255.0 U 10 0 0 eth0

169.254.0.0 0.0.0.0 255.255.0.0 U 10 0 0 eth0

169.254.0.0 0.0.0.0 255.255.0.0 U 35 0 0 ath0

0.0.0.0 192.168.2.1 0.0.0.0 UG 35 0 0 ath0

 

The "network" file:

 

NETWORKING=yes

HOSTNAME=Resheph

GATEWAY=192.168.2.1

FORWARD_IPV4=true

 

 

the /etc/sysconfig/network-scripts/ifcfg-ath0

 

DEVICE=ath0

BOOTPROTO=dhcp

ONBOOT=yes

METRIC=35

MII_NOT_SUPPORTED=no

USERCTL=yes

RESOLV_MODS=no

WIRELESS_MODE=Roaming

WIRELESS_ENC_KEY="open s:xxxxxxxxxx"

WIRELESS_WPA_DRIVER=madwifi

IPV6INIT=no

IPV6TO4INIT=no

DHCP_CLIENT=dhclient

NEEDHOSTNAME=yes

PEERDNS=yes

PEERYP=yes

PEERNTPD=no

 

and finally the /etc/sysconfig/network-scripts/ifcfg-eth0 config

 

DEVICE=eth0

BOOTPROTO=static

IPADDR=192.168.0.1

NETMASK=255.255.255.0

NETWORK=192.168.0.0

BROADCAST=192.168.0.255

GATEWAY=192.168.0.1

ONBOOT=yes

METRIC=10

MII_NOT_SUPPORTED=no

USERCTL=yes

MS_DNS1=192.168.0.1

RESOLV_MODS=yes

IPV6INIT=no

IPV6TO4INIT=no

 

So i think thats all....i hope you can fix the problem.

Edited by beomuex
Link to comment
Share on other sites

You can add the route command to /etc/rc.local so it's automatically done at boot.

 

Check if IP forwarding is enabled:

 

cat /proc/sys/net/ipv4/ip_forward

 

if it's a zero, it's not enabled. If it's 1, it's enabled. If not, you can set an option in /etc/sysctl.conf to enable it. I think it's:

 

net.ipv4.ip_forward=1

 

then run:

 

sysctl -p

 

to activate, and then check the file again to see if it has a 1 in it. Your machines should be able to access the internet theoretically after that, using the address of the wireless card as their default gateway, if that is the card you're wanting to share with them.

Link to comment
Share on other sites

Guest beomuex

Hi there,

 

 

cat /proc/sys/net/ipv4/ip_forward

 

So the file is totally empty!!!

 

But in the etc/sysctl.conf

is:

net.ipv4.ip_forward=1

 

But i noticed something else:

If I want ping the accesspoint with the PC2(the client)then there is nothing....but if i type the 192.168.2.1 in the mozilla's address field i can configure the router using the html control panel.So why can't I ping but configure the router.

btw pinging to the or through the router is possible from the PC1 and from PC2 i'm able to ping eth0(192.168.1.1 and ath0 192.168.2.103)

 

So i hope you can help me!!!

Link to comment
Share on other sites

Maybe the router has firewall and ping is blocked. And where is the router? Is the PC that is supposed to be sharing the connection between PC2 and the router? So, for example:

 

PC2 --> PC1 --> Router

 

Or is the network set up another way?

Link to comment
Share on other sites

Guest beomuex
PC2 --> PC1 --> Router

 

Or is the network set up another way?

 

you are right....the router has a firewall but this wall only blocks the pings from the www so from PC1 i can ping over WLAN.But if i want to ping with PC2...nothing...but i have access to the html control panel,but not farer than that^^?!The linux firewall is also deactivated.So i wonder why i can configure the router but not ping it and why the PC1 does not route the way it supposed to be....

Link to comment
Share on other sites

What are the IP address of each piece of your connection? I.E. PC1, PC2 and the Router.

 

The way you have it set up you must use slightly different IP ranges because you have two different networks, basically.

 

I.E. if the router is 192.168.0.1 and gives the IP of 192.168.0.2 to PC1, then PC1 will need to give out a different IP address to PC2 - i.e. 192.168.5.2 - and PC1 will also have a different IP for the network adapter that PC2 is connecting to - i.e. 192.168.5.1

 

You may find it easier to change your routers config to use something other than 192.168.0.X - as that's what Linux usually defaults to.

Link to comment
Share on other sites

Guest beomuex

So here a complete overview

 

PC1(windows 192.168.1.2)-------wired--------PC2(mdk2007 eth0=192.168.1.1 ath0=192.168.2.103 mac static)./:/:/:/:/WLAN:/:/:/:/:/Router 192.168.2.1

 

Subnet of all of them 255.255.255.0

 

now what do i have to change?

Link to comment
Share on other sites

That IP addressing should be fine as you have two different subnets.

 

PC1 should be using the 192.168.1.1 as it's default gateway. PC2 should have the router as it's default gateway if that is the route to the internet. Also, it should have valid DNS entries configured to be able to resolve hostnames.

 

And ip forwarding should be enabled to allow it to pass from one machine to another. If you can ping the router from PC1 then all is OK, and chances are you now have a DNS issue.

Link to comment
Share on other sites

Guest beomuex

iptables -A FORWARD -i eth0 -o ath0 -m state --state ESTABLISHED,RELATED -j ACCEPT

 

so thats the command, isn't it?

 

So do you mean that i need to use diffrent subnetmasks?

i tried it.......same shit=same problem...i can't ping but configure the router....

So with the DNS...PC2 has in 192.168.2.1(router)

PC1 has 10.0.0.1(tried a new ip-range to get a new subnet)

and PC2(10.0.01) has the DNS and gateway by 192.168.2.1(accesspoint)

 

So whats wrong?

Edited by beomuex
Link to comment
Share on other sites

on PC2, manually enter the DNS entries of your ISP into /etc/resolv.conf (or use MCC to do it, if it gives you the option to specify DNS). You should be able to get the two DNS servers from your router, or you can use OpenDNS.

Link to comment
Share on other sites

you need to give it a proper nameserver, your router should have this in it's web config under status or similar. If not just use the opendns ones:

nameserver 208.67.222.222
nameserver 208.67.220.220

and comment out the 192.168.2.1 entry:

#nameserver 192.168.2.1

so your file should look like this:

search Speedport_W_700V

nameserver 208.67.222.222
nameserver 208.67.220.220
#nameserver 192.168.2.1

Link to comment
Share on other sites

Guest beomuex

yeahhhhhhhhhhh...i'm happy no I'm surfing "safer, faster, and smarter

because i'am using OpenDNS."

 

So that don't fixes the problem taht i can't ping from the client to the router even tob the opendns servers.....i cant:t ping to any server but i can ping to my intern samba serv.....

Link to comment
Share on other sites

So changing the DNS servers did not give you access to the internet?

 

Does Mandriva no longer have the Internet Sharing Wizard they used to have in the Mandriva Control Center? If they do, have you tried that?

Link to comment
Share on other sites

Guest beomuex

so....#1...as i said i can surf in the internet with the pc2 but the pc1 has no access to the internet,it neither can ping to the router,but it has full access to my samba server which is running on PC2.But with PC1(the client) i can only configure the router NOT ping it Pc2 can....

#2 yes it has the tool and i used it...without dhcp and without SQUIP(because i don't know what it is)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...