![Can't connect Linux box directly to ISP (through modem)](https://linux22.com/image/1521624/Can't%20connect%20Linux%20box%20directly%20to%20ISP%20(through%20modem).png)
I have a Cisco EPC2202 modem given to me from my ISP. The modem connects to a TPLink router through an Ethernet Cat 5e cable. My desktop computer which is running CentOS 7 is connected to the TPLink router through an Ethernet Cat 5e cable.
I wanted to try an experiment and connect my CentOS computer directly to the modem, without using the TPLink router.
When I connect my computer directly to the modem using an Ethernet Cat 5e cable, NetworkManager (which is running dhclient for my ethernet interface) isn't able to give my interface an IP address. So, I decided to try manually. I saw the IP address, subnet mask and default gateway my TPLink router is receiving from my ISP through the web interface of the TPLink router. I configured the exact same settings on my Ethernet interface on my CentOS computer. I am still not able to ping 8.8.8.8
. Traceroute packets aren't going out either.
Commands I used to configure my Ethernet (enp4s0f2) interface on my CentOS computer:
service NetworkManager stop ip addr flush dev enp4s0f2 ip address add |My_public_IP_Address|/|Subnet_mask| dev enp4s0f2 broadcast + ip route add to unicast 0.0.0.0/0 via |Default_gateway_IP_address_of_my_TPLink_router|
The commands pass without giving any errors and ip addr show
and ip route show
confirm that. Maybe they are using some VLAN configuration or PPP over Ethernet or something that my CentOS box doesn't understand?
答案1
How is/was the TPLink router configured? If via DHCP, then you can do the same on your Linux box. Note that some "modems" and/or service providers remember the MAC address plugged in and need to be rebooted in order to see and service a new MAC. Although I've mostly seen this with cable modems.
If the TPLink wasn't configured via DHCP, then you probably need to set up PPPoE. Been a long time since I've done it, but the Roaring Penguin PPoE client works/worked well for me.