LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2013, 12:04 PM   #1
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Rep: Reputation: 119Reputation: 119
Configuring Static IP CentOS so router Motorola NVG510 can recognize device and port forward NAT.


Hello and thanks for reading,

So I've been working with Linux servers for a good while now and the way I've always done things have always worked....Until NOW that is.

Basically AT&T upgraded my internet residential service from DSL to there new Uverse setup which required a new modem. The modem is also a router with a built in firewall (typical router).

So Basically I've been playing with Virtual Machines which I created servers and some I need to broadcast to the open world. Now I know AT&T has the ports open, but the problem I'm experiencing, where a typical router allows you to do Port Fowarding/NAT and you basically forward a port to a host number.

All my servers I've created and communicate with the openwords.

Now this new router just doesn't let me forward a port to a host unless its in the Device list.

Now this is what I can't figure if I use DHCP it works and pulls and address, but it still not in the Device List. On my Linux Mint Virtual Machine I can use DHCP with the network manager and the device is listed. That is the James-VirtualBox.

So basically what I want to know is how do I forward the host/device name to the router on my CentOS installation pulling a static IP?

I've attached the a pic for the Router Port forwarding

Code:
[root@oknode ~]# ping linuxquestions.org
PING linuxquestions.org (75.126.162.205) 56(84) bytes of data.
64 bytes from www.linuxquestions.org (75.126.162.205): icmp_seq=1 ttl=53 time=27.7 ms
64 bytes from www.linuxquestions.org (75.126.162.205): icmp_seq=2 ttl=53 time=27.2 ms
^C
--- linuxquestions.org ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1457ms
rtt min/avg/max/mdev = 27.285/27.494/27.704/0.267 ms
[root@oknode ~]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:17:31:88:53:0B
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::217:31ff:fe88:530b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7973 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2714 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:843689 (823.9 KiB)  TX bytes:281403 (274.8 KiB)
          Interrupt:20 Base address:0x2c00

[root@oknode ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
HOSTNAME=oknode.xxx.org
NETMASK=255.255.255.0
IPADDR=192.168.1.101
HWADDR=00:17:31:88:53:0B

[root@oknode ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
link-local      *               255.255.0.0     U     1002   0        0 eth0
default         dsldevice.att.n 0.0.0.0         UG    0      0        0 eth0
[root@oknode ~]# cat /etc/hosts
127.0.0.1   localhost oknode.xxx.org oknode
192.168.1.101 oknode.xxx.org oknode

# Yes the xxx in the domain name is edited out
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	44
Size:	54.6 KB
ID:	13661  

Last edited by jmc1987; 10-08-2013 at 09:42 PM.
 
Old 10-07-2013, 12:27 PM   #2
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
Mixing static IPs together with DHCP in my experience is not so good. As number of devices grow over time ip conflicts are possible. Furthermore if you need to change the subnet one day it can give trouble. You can statically bind an ip on the dhcp server to a specific Mac-address.

About your question. How do you add a device into the list ? I suppose binding an ip will do it?
 
Old 10-07-2013, 12:43 PM   #3
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by redfox2807 View Post
Mixing static IPs together with DHCP in my experience is not so good. As number of devices grow over time ip conflicts are possible. Furthermore if you need to change the subnet one day it can give trouble. You can statically bind an ip on the dhcp server to a specific Mac-address.

About your question. How do you add a device into the list ? I suppose binding an ip will do it?
The router doesn't appear to support that directly, its got some auto settings that tend to do this its self.

Yes I know DHCP and Static can cause conflicts. That is why I configure DHCP server only forwards ips between 2 and 99
 
Old 10-07-2013, 01:01 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
you can have ATT disable all routing functions on their device and set it to bridge mode. that will solve your issue. put your router behind it as they will disable their firewall, DHCP, and NAT.
 
Old 10-07-2013, 01:37 PM   #5
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by lleb View Post
you can have ATT disable all routing functions on their device and set it to bridge mode. that will solve your issue. put your router behind it as they will disable their firewall, DHCP, and NAT.
Yes you are right indeed, I do like having the router firewall but in this case it all fails, Bridge mode is a great idea which I've done that with some previous routers that solved that problem easily and non complicated.

The no modem/router I have is Motorola NVG510 which doesn't exactly support bridge mode so it really seems I need a different modem, but there is a little hope. I have found where a few people have done it.

http://forums.att.com/t5/Features-an...e/td-p/2890841

But, I'm still going to work to find some more solutions.
 
Old 10-07-2013, 01:52 PM   #6
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
If you want to replace the DSL modem you can consider buying a router with DSL support. Just to get rid of one more device. I don't know if AT&T lets its customers to be off without AT&T-owned modems.
 
Old 10-07-2013, 02:05 PM   #7
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Original Poster
Rep: Reputation: 119Reputation: 119
Well when AT&T was offering standard ADSL you could use your own router equipment. Now since I'm on the Uverse Technology I'm not sure if a standard DSL model will work or not. From what I understand its a beefed up DSL Line, but I guess that is really something I would have to consult them about, of course I'm sure that have a business class router they would sell me for lots of $$ that would easily solve the trick, but not looking to pay a arm & leg for something that should be so simple in the first place.

But I'll find a solution eventually, hopefully sooner rather than later, and I know some others have had issue with this so I'll be sure to post my results when I solve my problem.

I guess on to more hours of hopeless research =) Cheers!
 
Old 10-07-2013, 02:15 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by redfox2807 View Post
Mixing static IPs together with DHCP in my experience is not so good. As number of devices grow over time ip conflicts are possible.
As long as you restrict the DHCP range and set all of your static IPs outside of that range, you'll never have a conflict.

Quote:
Originally Posted by redfox2807 View Post
Furthermore if you need to change the subnet one day it can give trouble. You can statically bind an ip on the dhcp server to a specific Mac-address.
If you do that you'll face just as many problems if you ever change your router. Just trading one headache for another.
 
Old 10-07-2013, 02:23 PM   #9
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
According to this page in case of Uverse AT&T forces customers to use their equipment. Then switching Motorola NVG510 to some low cost modem that supports bridging and setting up your home network behind a router you have complete control of will be best option. Also you won't have to pay extra bucks for an AT&T router that could be easily bought from a 3rd party for less price.
 
Old 10-07-2013, 02:31 PM   #10
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
In the past, when dealing with ISP-supplied modem/router hybrids that don't have a "bridge mode" setting and typically have terrible interfaces and functionality, I've been able to "force" it to be a transparent bridge by assigning my primary router a static IP on the ISP-supplied router's network, and telling the ISP-supplied router to forward everything on every port to my primary router. The primary router then handles the firewall and various port forwarding like normal.

This does create a double NAT with two subnets (but the only device on one of the subnets is your primary router), but sometimes it's the cleanest way to get past the ISP device's restrictions.

Last edited by suicidaleggroll; 10-07-2013 at 02:42 PM.
 
Old 10-07-2013, 02:38 PM   #11
redfox2807
Member
 
Registered: Jul 2012
Distribution: Debian testing/stable, Gentoo, CentOS 7, Sailfish OS, Android
Posts: 167

Rep: Reputation: 31
Quote:
Originally Posted by suicidaleggroll View Post
As long as you restrict the DHCP range and set all of your static IPs outside of that range, you'll never have a conflict.
As your network grows you can face lack of unused IP addresses. Another headache is to remember all those static IP addresses in use (or to find where is that file you have saved those IPs in =)). Though I have to admit it more applies to small company networks than to home ones.

Quote:
Originally Posted by suicidaleggroll View Post
If you do that you'll face just as many problems if you ever change your router. Just trading one headache for another.
Indeed. That hardly can be argued.
 
Old 10-07-2013, 08:00 PM   #12
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Original Poster
Rep: Reputation: 119Reputation: 119
Well I almost got a break through. I finally got my CentOS machine to show up in my device list on my router by changing my centos machine to dynamic ip.

Quote:
[root@oknode network-scripts]# cat ifcfg-eth0
DEVICE=eth0
HWADDR=00:17:31:88:53:0B
ONBOOT=yes
BOOTPROTO=dhcp
HOSTNAME=oknode.xxx.org
DHCP_HOSTNAME=oknode
#NETMASK=255.255.255.0
#IPADDR=192.168.1.101
Basically by changing to DHCP and added "DHCP_HOSTNAME=oknode" it broadcasted the name to the router so I can forward a port to it. So now the question is, since this is a openvz machine can I broadcast that name using a static IP. I think that will solve my problem for the most part. So is that possible.

Or am I stuck using DHCP on all my openVZ containers too (yikes).

I found out att uverse is adsl2+ technology so I'll probably on a venture to by a new modem, since I called there tier 2 support and they told me I have to pay their outsourced support department for assistance with that port forward. ATT is going down hill, I thinking a local cable company is in mind.
 
Old 10-08-2013, 09:41 PM   #13
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 893

Original Poster
Rep: Reputation: 119Reputation: 119
Router: Motorola NVG510

Okay well since my router is junk, I did find a more simple work around other then what other people have proposed. Its working on my network with my OpenVZ Node and the VPS containers on the node. Note: Openvz venet will not work properly for the portforwarding, but venet device will work find behind the router (local network)

Since my router has somekind of caching system which I'm going to assume it binds the dhcp address by mac/dhcp_hostname so I basically configured my ifcfg-eth0 to use dhcp
Code:
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=dhcp
HOSTNAME=oknode.xxx.org
DHCP_HOSTNAME=oknode
HWADDR=00:17:31:88:53:0B
Now once my server requested the IP server which is pulls 192.168.1.64.
This is how its displayed in my network device list on my router Device > Device List
Code:

Device IPv4 Address / Name 	MAC Address 	        Status 	   Connection 	   Allocation
192.168.1.64 / oknode	        00:17:31:88:53:0b	on	   Ethernet	   dhcp
my centos machine now existed in the device list in my NAT Portforward in the Router GUI.
So Now that information is cached in the router I changed it back to static IP like this
Code:
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
BOOTPROTO=none
HWADDR=00:17:31:88:53:0B
HOSTNAME=oknode.xxx.org
NETMASK=255.255.255.0
IPADDR=192.168.1.101
GATEWAY=192.168.1.254
My router now sees my static IP and it keeps the device name oknode. Basically it looks like this in my router Device List
Code:
Device IPv4 Address / Name 	MAC Address 	        Status 	   Connection 	   Allocation
192.168.1.101 / oknode	        00:17:31:88:53:0b	on	   Ethernet	   static
So at this point I think its safe to say its updated like it should.

Now in my router GUI I can go to my firewall > NAT/Gaming > select my services I want to port forward and my device name can be selected from the device list.

Now for some addition info for the work around for the openvz containers thats on my server. You have to use veth and not venet network devices, basically you have to bridge your network device such as this
Code:
# vi /etc/sysconfig/network-scripts/ifcfg-vmbr0 
DEVICE="vmbr0"
BOOTPROTO="static"
IPV6INIT="no"
ONBOOT="yes"
TYPE="Bridge"
DELAY=0
IPADDR=192.168.1.101
NETMASK=255.255.255.0
GATEWAY=192.168.1.254

# vi /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE="eth0"
ONBOOT="yes"
IPV6INIT="no"
TYPE="Ethernet"
BRIDGE="vmbr0"
OpenVZ has a script you need to add to automate the veth devices.
# vi /etc/vz/vznet.conf
Quote:
#!/bin/bash
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
Stop your openvz container and add the veth device to openvz container
# vzctl set <CID> --netif_add eth0 --save

Now edit your container/VE/VPS network scripts

# vi /vz/root/102/etc/sysconfig/network-scripts/ifcfg-eth0
Quote:
DEVICE="eth0"
HOSTNAME="vps1"
MTU="1500"
TYPE="Ethernet"
ONBOOT=yes
BOOTPROTO=dhcp
DHCP_HOSTNAME=vps1
Now this will populate and pull from the router and bind the mac of the veth device and it will cache in the router.

Now go back and change it to static
# vi /vz/root/102/etc/sysconfig/network-scripts/ifcfg-eth0
Quote:
DEVICE="eth0"
HOSTNAME="vps"
TYPE="Ethernet"
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.102
NETMASK=255.255.255.0
GATEWAY=192.168.1.254
Now again successfully the router device populates in the list under the router firewall>NAT/Gaming and you can select the device and open the ports needed.
Most of this information is not in a manual or anywhere on the web to make a server work with static ips with port forward with this modem/router so I hope this work around will help somebody.

Last edited by jmc1987; 10-08-2013 at 09:54 PM.
 
  


Reply



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
Configuring CentOS as a router DK907 Linux - Networking 4 05-16-2013 01:54 PM
Configuring static ip Niranjang Linux - Newbie 3 11-07-2008 04:50 AM
How to set up static IP/Broadband Router on CentOS to use Internet? linux_related Linux - Networking 23 09-19-2007 01:01 AM
Configuring boot to recognize other Linux partitions audiorevolution Linux - Newbie 1 05-23-2005 05:18 AM
Configuring Static IP nasrudin Linux - Networking 16 01-12-2005 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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