0

I have a Linux machine with two network interfaces, and I'd like to get the IP address of the PPP interface w1g1 but it doesn't show up in ifconfig. There is a public IP on the PPP interface, but there is no internet connection, I'm trying to troubleshoot but I need to get the IP address of the interface and I can't.

ifconfig :

eth0      Link encap:Ethernet  HWaddr 00:30:48:8D:F0:2C
          inet addr:192.168.2.254  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::230:48ff:fe8d:f02c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9970 errors:0 dropped:567 overruns:0 frame:0
          TX packets:4338 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:1441024 (1.3 MiB)  TX bytes:915814 (894.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:675 errors:0 dropped:0 overruns:0 frame:0
          TX packets:675 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:50659 (49.4 KiB)  TX bytes:50659 (49.4 KiB)

w1g1      Link encap:Point-to-Point Protocol
          UP POINTOPOINT RUNNING NOARP  MTU:240  Metric:1
          RX packets:748994 errors:0 dropped:0 overruns:0 frame:0
          TX packets:748992 errors:0 dropped:0 overruns:0 carrier:3
          collisions:0 txqueuelen:100
          RX bytes:179758560 (171.4 MiB)  TX bytes:179758080 (171.4 MiB)
          Interrupt:177 Memory:f881c400-f881e3ff

w1g1 is connected to a modem by an RJ45<->Serial cable and the modem is connected to the phone line. The modem is a NOKIA DNT2Mi you can see it here

Routing table :

192.168.2.0/24 dev eth0  proto kernel  scope link  src 192.168.2.254
169.254.0.0/16 dev eth0  scope link
default via 192.168.2.180 dev eth0
Xsmael
  • 171
  • 1
  • 10
  • 2
    There is no IP on that interface, and that's most likely why you don't have an internet connection. –  Aug 21 '14 at 14:27
  • 3
    Sidenote: `ifconfig` is deprecated in Linux now. You should be using `ip`. – Chris S Aug 21 '14 at 14:30
  • @AndréDaniel But when i ping the Ip address supposed to be on that interface it answers,how can you explain that ? (I do the ping from the same computer, it't not working elsewhere ) – Xsmael Aug 21 '14 at 14:40
  • 1
    Do you have ping through-t : `ping -I w1g1 8.8.8.8` ? – PersianGulf Aug 21 '14 at 14:41
  • @Xsmael are you sure your ping isn't going through `eth0` instead ? Can you edit your question and add the current routing table, accessible with `route` or `ip route show` (if I remember right) ? –  Aug 21 '14 at 14:44
  • it's not working, here is the result: `connect: No such device` – Xsmael Aug 21 '14 at 14:45
  • @AndréDaniel You're right, I updated the post with the routing table, but even when I ping that public IP from another network it doesn't answer. and it was working 1week ago, I don't know what happened. – Xsmael Aug 21 '14 at 14:51
  • Have you tried restarting pppd on both ends? If that doesn't work, as a workaround i think you should add IP and routes manually. – LatinSuD Aug 21 '14 at 14:53
  • Also, what is the modem's make/model ? And did this even work before ? Looking at the cable I'm pretty sure it won't work because you need more than a `dumb` cable like that to convert Ethernet to serial, unless the modem is already outputting Ethernet but on a serial connector. –  Aug 21 '14 at 14:58
  • @LatinSuD is pppd a service or something ? I can't restart it with `service ... restart` how should I do it ? – Xsmael Aug 21 '14 at 15:03
  • Rather, restart the modem and the computer? – LatinSuD Aug 21 '14 at 15:05
  • @AndréDaniel the modem is a NOKIA DNT2Mi. Yes it was working before, I don't know what happened. and the modem has no other ouputs than the serial port. so, we are a obliged to use that "dumb" cable. – Xsmael Aug 21 '14 at 15:06
  • @LatinSuD Already done that! but no way. – Xsmael Aug 21 '14 at 15:07
  • Run: ip addr show dev The output should contain `inet x.x.x.x/x` if the interface has an IPv4 address. – xnor Aug 21 '14 at 15:13
  • @xnor It doesn't show an Ip address but this: `6: w1g1: mtu 240 qdisc pfifo_fast qlen 100 link/ppp` – Xsmael Aug 21 '14 at 15:15
  • I'm confused, how do you even start the PPP connection in the first place ? Can you add your pppd configuration files ? –  Aug 21 '14 at 16:03
  • it was not me who configured that PPP connection I even never heard about it, I was a bit suprised when I saw it after running `ifconfig` The guy who did it is gone, so if you can tell me the path of configuration files i'll post it! – Xsmael Aug 22 '14 at 15:26

2 Answers2

1

You didn't say what distribution you are using, but it looks like your w1g1 interface does not even have an IP address.

My suggestion is to bring pppd down and restart it.

On most distributions, the easy way is to use these commands:

ifdown w1g1
ifup w1g1

If that doesn't work and you are not trying this remotely, you might want to stop all networking and restart it:

service network stop
service network start
Scott Nelson
  • 285
  • 1
  • 10
  • ok, Tried to restart the network interface w1g1, with `ifdown w1g1` and `ifup w1g1' but surprisingly it doesn't work, it answers `usage: ifdown ` it's like it doesn't recognize w1g1 even though that name appears when i run `ifconfig`. – Xsmael Aug 22 '14 at 14:15
  • whent restart the network service, all the interfaces are restarted except w1g1. do you know what's happening ? – Xsmael Aug 22 '14 at 15:42
  • The ifup/ifdown/service network start/stop commands all depend on configuration files in /etc/sysconfig/network-scripts called ifcfg-XXX (where XXX is the device name). The linux kernel itself does not depend on those files, so other programs/scripts/commands can be used to create interfaces as well, but I can't help without more information about what command was used to create w1g1. – Scott Nelson Sep 01 '14 at 15:47
0

My answer was deleted, I cannot comment, so here I try again:

Run:

ip addr show

or

ifconfig -a

Maybe you are just looking at the wrong interface? Look for the interface with the IP that you can ping.

A google search for "w1g1" resulted in stuff like:

your PPP interface will come up as w*g1ppp. (for example w1g1ppp)

xnor
  • 101
  • 1
  • There are two interfaces: one for LAN(private IP) and the other for WAN(public IP), I can ping both IP addresses with no problem, but when I run `ifconfig` the ip address of w1g1 doesn't appear as you can see on my post but when I ping his ip address it answers! – Xsmael Aug 22 '14 at 15:41