tajiknomi
Posts: 11
Joined: Thu Jan 01, 2015 2:52 pm

Gateway problem in PI

Tue Jan 06, 2015 2:32 pm

I have Connected PI to Router using Ethernet and i'm able to access it via SSH, But the Problem is ,

1) PI isn't Picking my Gateway Automatically.
2) I had Edited my "/etc/network/interfaces".
3)I had add a line for the Gateway but it doesn't work
4)Every time i had to manually give "Gateway" address to Pi in order to connect it to the internet by using following Command.."
" sudo route add default gw 192.168.1.1 " after this , I'm able to access the WEB.
5) Its Irritating that i had to do this manually everytime.
6)I have attached my "interface" file along with > https://dl.dropboxusercontent.com/u/161 ... erface.JPG

I don't know whats the Problem is, Any Solution will be be appreciated, thanx

drgeoff
Posts: 10620
Joined: Wed Jan 25, 2012 6:39 pm

Re: Gateway problem in PI

Tue Jan 06, 2015 2:38 pm

Please do not post the same question twice.

You posted the exact same question 5 days ago. More than 70 people looked at it but no-one replied.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Gateway problem in PI

Tue Jan 06, 2015 2:55 pm

Here's mine, been running for the better part of two years...

Code: Select all

auto lo

iface lo inet loopback
#iface eth0 inet dhcp

# The primary network interface
auto eth0
iface eth0 inet static
  address 192.168.1.254
  netmask 255.255.255.0
  network 192.168.1.0
  broadcast 192.168.1.255
  gateway 192.168.1.1
To keep the right side of Dougie, I should point out that the network and broadcast lines are optional ;) Feel free to adjust to suit. I took all the wlan stuff out since I never use wifi on it.

It might work if you hashed the last line of yours....
.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

tajiknomi
Posts: 11
Joined: Thu Jan 01, 2015 2:52 pm

Re: Gateway problem in PI

Wed Jan 07, 2015 9:25 pm

Problem Solved,
I just removed the ip=xxx:xxx from "cmdline" and it worked....
Thnkx 4 feedback

Return to “Troubleshooting”